#include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h"
#include <algorithm>
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/views/extensions/extension_popup.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/permissions/permission_prompt_bubble_base_view.h"
#include "components/autofill/core/browser/ui/popup_open_enums.h"
#include "components/autofill/core/browser/ui/suggestion_type.h"
#include "components/autofill/core/common/autofill_features.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/constants.h"
#include "ui/base/interaction/element_tracker.h"
#include "ui/views/interaction/element_tracker_views.h"
#include "ui/views/widget/widget.h"
BubbleBorder;
namespace autofill {
namespace {
constexpr int kMinimalPopupDistanceToContentAreaEdge = …;
bool IsVerticalArrowSide(views::BubbleArrowSide side) { … }
bool IsElementSufficientlyVisibleForAVerticalArrow(
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
views::BubbleArrowSide side) { … }
BubbleBorder::Arrow GetBubbleArrowForBubbleArrowSide(
views::BubbleArrowSide side,
bool right_to_left) { … }
gfx::Size GetExpandedPopupSize(const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
const gfx::Size& popup_preferred_size,
int scrollbar_width,
views::BubbleArrowSide side) { … }
}
void CalculatePopupYAndHeight(int popup_preferred_height,
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
gfx::Rect* popup_bounds) { … }
bool CanShowDropdownHere(int item_height,
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds) { … }
bool BoundsOverlapWithAnyOpenPrompt(const gfx::Rect& screen_bounds,
content::WebContents* web_contents) { … }
bool BoundsOverlapWithOpenPermissionsPrompt(
const gfx::Rect& screen_bounds,
content::WebContents* web_contents) { … }
bool BoundsOverlapWithPictureInPictureWindow(const gfx::Rect& screen_bounds) { … }
bool PopupMayExceedContentAreaBounds(content::WebContents* web_contents) { … }
int GetAvailableVerticalSpaceOnSideOfElement(
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
views::BubbleArrowSide side) { … }
int GetAvailableHorizontalSpaceOnSideOfElement(
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
views::BubbleArrowSide side) { … }
bool IsPopupPlaceableOnSideOfElement(const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
const gfx::Size& popup_preferred_size,
int additional_spacing,
views::BubbleArrowSide side) { … }
views::BubbleArrowSide GetOptimalArrowSide(
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
const gfx::Size& popup_preferred_size,
base::span<const views::BubbleArrowSide> popup_preferred_sides,
PopupAnchorType anchor_type) { … }
BubbleBorder::Arrow GetOptimalPopupPlacement(
const gfx::Rect& content_area_bounds,
const gfx::Rect& element_bounds,
const gfx::Size& popup_preferred_size,
bool right_to_left,
int scrollbar_width,
int maximum_pixel_offset_to_center,
int maximum_width_percentage_to_center,
gfx::Rect& popup_bounds,
base::span<const views::BubbleArrowSide> popup_preferred_sides,
PopupAnchorType anchor_type) { … }
bool IsExpandableSuggestionType(SuggestionType type) { … }
}