Commit d83d2aa0 authored by Charlene Yan's avatar Charlene Yan Committed by Commit Bot

Remove set_anchor_view_insets inside src/chrome/browser/ui.

Will still need to remove calls inside src/ash before it can be fully removed from src/ui/views/bubble/bubble_dialog_delegate_view.h

Bug: 869928
Change-Id: I0444a7c3d6440d7be1dfe99c26996f2524d8f29a
Reviewed-on: https://chromium-review.googlesource.com/1173321Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Charlene Yan <cyan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582925}
parent bee81c97
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "chrome/browser/plugins/plugin_finder.h" #include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/browser/plugins/plugin_metadata.h" #include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/content_setting_domain_list_view.h" #include "chrome/browser/ui/views/content_setting_domain_list_view.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/browser/ui/views/harmony/chrome_typography.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h"
...@@ -372,9 +371,6 @@ ContentSettingBubbleContents::ContentSettingBubbleContents( ...@@ -372,9 +371,6 @@ ContentSettingBubbleContents::ContentSettingBubbleContents(
manage_button_(nullptr), manage_button_(nullptr),
manage_checkbox_(nullptr), manage_checkbox_(nullptr),
learn_more_button_(nullptr) { learn_more_button_(nullptr) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
chrome::RecordDialogCreation( chrome::RecordDialogCreation(
chrome::DialogIdentifier::CONTENT_SETTING_CONTENTS); chrome::DialogIdentifier::CONTENT_SETTING_CONTENTS);
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "chrome/browser/ui/global_error/global_error.h" #include "chrome/browser/ui/global_error/global_error.h"
#include "chrome/browser/ui/global_error/global_error_service.h" #include "chrome/browser/ui/global_error/global_error_service.h"
#include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/elevation_icon_setter.h" #include "chrome/browser/ui/views/elevation_icon_setter.h"
#include "chrome/browser/ui/views/frame/app_menu_button.h" #include "chrome/browser/ui/views/frame/app_menu_button.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
...@@ -136,10 +135,6 @@ void GlobalErrorBubbleView::Init() { ...@@ -136,10 +135,6 @@ void GlobalErrorBubbleView::Init() {
// |error_| is assumed to be valid, and stay valid, at least until Init() // |error_| is assumed to be valid, and stay valid, at least until Init()
// returns. // returns.
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
std::vector<base::string16> message_strings(error_->GetBubbleViewMessages()); std::vector<base::string16> message_strings(error_->GetBubbleViewMessages());
std::vector<views::Label*> message_labels; std::vector<views::Label*> message_labels;
for (size_t i = 0; i < message_strings.size(); ++i) { for (size_t i = 0; i < message_strings.size(); ++i) {
......
...@@ -68,13 +68,6 @@ LocationBarBubbleDelegateView::LocationBarBubbleDelegateView( ...@@ -68,13 +68,6 @@ LocationBarBubbleDelegateView::LocationBarBubbleDelegateView(
} }
if (!anchor_view) if (!anchor_view)
SetAnchorRect(gfx::Rect(anchor_point, gfx::Size())); SetAnchorRect(gfx::Rect(anchor_point, gfx::Size()));
// Compensate for built-in vertical padding in the anchor view's image.
// In the case of Harmony, this is just compensating for the location bar's
// border thickness, as the bubble's top border should overlap it.
// When anchor is controlled by the |anchor_point| this inset is ignored.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
} }
LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {} LocationBarBubbleDelegateView::~LocationBarBubbleDelegateView() {}
...@@ -115,6 +108,13 @@ void LocationBarBubbleDelegateView::WebContentsDestroyed() { ...@@ -115,6 +108,13 @@ void LocationBarBubbleDelegateView::WebContentsDestroyed() {
CloseBubble(); CloseBubble();
} }
gfx::Rect LocationBarBubbleDelegateView::GetAnchorBoundsInScreen() const {
gfx::Rect bounds = GetBoundsInScreen();
bounds.Inset(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
return bounds;
}
void LocationBarBubbleDelegateView::AdjustForFullscreen( void LocationBarBubbleDelegateView::AdjustForFullscreen(
const gfx::Rect& screen_bounds) { const gfx::Rect& screen_bounds) {
if (GetAnchorView()) if (GetAnchorView())
......
...@@ -59,6 +59,8 @@ class LocationBarBubbleDelegateView : public views::BubbleDialogDelegateView, ...@@ -59,6 +59,8 @@ class LocationBarBubbleDelegateView : public views::BubbleDialogDelegateView,
void OnVisibilityChanged(content::Visibility visibility) override; void OnVisibilityChanged(content::Visibility visibility) override;
void WebContentsDestroyed() override; void WebContentsDestroyed() override;
gfx::Rect GetAnchorBoundsInScreen() const override;
// If the bubble is not anchored to a view, places the bubble in the top right // If the bubble is not anchored to a view, places the bubble in the top right
// (left in RTL) of the |screen_bounds| that contain web contents's browser // (left in RTL) of the |screen_bounds| that contain web contents's browser
// window. Because the positioning is based on the size of the bubble, this // window. Because the positioning is based on the size of the bubble, this
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/network_profile_bubble.h" #include "chrome/browser/ui/network_profile_bubble.h"
#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h" #include "chrome/browser/ui/views/toolbar/browser_app_menu_button.h"
...@@ -63,9 +62,6 @@ NetworkProfileBubbleView::NetworkProfileBubbleView( ...@@ -63,9 +62,6 @@ NetworkProfileBubbleView::NetworkProfileBubbleView(
: BubbleDialogDelegateView(anchor, views::BubbleBorder::TOP_RIGHT), : BubbleDialogDelegateView(anchor, views::BubbleBorder::TOP_RIGHT),
navigator_(navigator), navigator_(navigator),
profile_(profile) { profile_(profile) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
chrome::RecordDialogCreation( chrome::RecordDialogCreation(
chrome::DialogIdentifier::NETWORK_SHARE_PROFILE_WARNING); chrome::DialogIdentifier::NETWORK_SHARE_PROFILE_WARNING);
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/browser/upgrade_detector/upgrade_detector.h" #include "chrome/browser/upgrade_detector/upgrade_detector.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -170,8 +169,5 @@ OutdatedUpgradeBubbleView::OutdatedUpgradeBubbleView( ...@@ -170,8 +169,5 @@ OutdatedUpgradeBubbleView::OutdatedUpgradeBubbleView(
: BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT),
auto_update_enabled_(auto_update_enabled), auto_update_enabled_(auto_update_enabled),
navigator_(navigator) { navigator_(navigator) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
chrome::RecordDialogCreation(chrome::DialogIdentifier::OUTDATED_UPGRADE); chrome::RecordDialogCreation(chrome::DialogIdentifier::OUTDATED_UPGRADE);
} }
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "chrome/browser/ui/views/page_info/page_info_bubble_view_base.h" #include "chrome/browser/ui/views/page_info/page_info_bubble_view_base.h"
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/page_info/page_info_dialog.h" #include "chrome/browser/ui/page_info/page_info_dialog.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -51,10 +50,6 @@ PageInfoBubbleViewBase::PageInfoBubbleViewBase( ...@@ -51,10 +50,6 @@ PageInfoBubbleViewBase::PageInfoBubbleViewBase(
set_parent_window(parent_window); set_parent_window(parent_window);
if (!anchor_view) if (!anchor_view)
SetAnchorRect(anchor_rect); SetAnchorRect(anchor_rect);
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
} }
int PageInfoBubbleViewBase::GetDialogButtons() const { int PageInfoBubbleViewBase::GetDialogButtons() const {
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/bubble_anchor_util_views.h" #include "chrome/browser/ui/views/bubble_anchor_util_views.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/browser/ui/views/page_info/permission_selector_row.h" #include "chrome/browser/ui/views/page_info/permission_selector_row.h"
...@@ -302,11 +301,6 @@ void PermissionPromptImpl::Show() { ...@@ -302,11 +301,6 @@ void PermissionPromptImpl::Show() {
bubble_delegate_->set_parent_window( bubble_delegate_->set_parent_window(
platform_util::GetViewForWindow(browser_->window()->GetNativeWindow())); platform_util::GetViewForWindow(browser_->window()->GetNativeWindow()));
// Compensate for vertical padding in the anchor view's image. Note this is
// ignored whenever the anchor view is null.
bubble_delegate_->set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
views::Widget* widget = views::Widget* widget =
views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_); views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_);
// If a browser window (or popup) other than the bubble parent has focus, // If a browser window (or popup) other than the bubble parent has focus,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment