chromium/chrome/browser/ui/views/autofill/popup/popup_base_view.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/autofill/popup/popup_base_view.h"

#include <algorithm>
#include <memory>
#include <string_view>
#include <utility>

#include "base/dcheck_is_on.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/i18n/rtl.h"
#include "base/location.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/autofill/popup/custom_cursor_suppressor.h"
#include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/contents_web_view.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/password_manager/core/browser/features/password_features.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/platform/ax_platform_node.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_id.h"
#include "ui/color/color_provider.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/scrollbar_size.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/border.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/controls/menu/menu_config.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/widget/widget.h"

#if DCHECK_IS_ON()
#include "base/containers/fixed_flat_set.h"
#endif

namespace autofill {

namespace {

// The maximum size (in DIPs) of custom cursors that are permitted while the
// popup is shown. The size is limited to avoid custom cursors that cover most
// of the popup.
constexpr int kMaximumAllowedCustomCursorDimension =;

// The maximum number of pixels the suggestions dialog is shifted towards the
// center the focused field.
constexpr int kMaximumPixelsToMoveSuggestionToCenter =;

// The maximum width percentage the suggestion dialog is shifted towards the
// center of the focused field.
constexpr int kMaximumWidthPercentageToMoveTheSuggestionToCenter =;

// The max number of pixels the popup is allowed to be rendered above the top
// of the `WebContents`. Limiting overflow prevents the popup content from
// covering important browser elements (e.g., the address bar).
constexpr int kMaxPopupWebContentsTopYOverflow =;

// Creates a border for a popup.
std::unique_ptr<views::Border> CreateBorder() {}

}  // namespace

// static
int PopupBaseView::GetCornerRadius() {}

// static
int PopupBaseView::ArrowHorizontalMargin() {}

// The widget that the PopupBaseView will be attached to.
class PopupBaseView::Widget : public views::Widget {};

PopupBaseView::PopupBaseView(
    base::WeakPtr<AutofillPopupViewDelegate> delegate,
    views::Widget* parent_widget,
    views::Widget::InitParams::Activatable new_widget_activatable,
    bool show_arrow_pointer)
    :{}

PopupBaseView::~PopupBaseView() {}

Browser* PopupBaseView::GetBrowser() {}

bool PopupBaseView::DoShow() {}

void PopupBaseView::DoHide() {}

void PopupBaseView::NotifyAXSelection(views::View& selected_view) {}

void PopupBaseView::OnWidgetBoundsChanged(views::Widget* widget,
                                          const gfx::Rect& new_bounds) {}

void PopupBaseView::OnWidgetDestroying(views::Widget* widget) {}

void PopupBaseView::RemoveWidgetObservers() {}

void PopupBaseView::UpdateClipPath() {}

gfx::Rect PopupBaseView::GetContentAreaBounds() const {}

gfx::Rect PopupBaseView::GetTopWindowBounds() const {}

gfx::Rect PopupBaseView::GetOptimalPositionAndPlaceArrowOnPopup(
    const gfx::Rect& element_bounds,
    const gfx::Rect& max_bounds_for_popup,
    const gfx::Size& preferred_size,
    base::span<const views::BubbleArrowSide> preferred_popup_sides) {}

bool PopupBaseView::DoUpdateBoundsAndRedrawPopup() {}

void PopupBaseView::OnNativeFocusChanged(gfx::NativeView focused_now) {}

void PopupBaseView::HideController(SuggestionHidingReason reason) {}

content::WebContents* PopupBaseView::GetWebContents() const {}

BEGIN_METADATA()

}  // namespace autofill