diff options
author | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 18:59:57 +0000 |
---|---|---|
committer | sail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-08 18:59:57 +0000 |
commit | 9a85f4cde6f4b702cb249768ba0a18dbc1766907 (patch) | |
tree | 4f34b1bab489172125eecaf5f2207ebca106c002 | |
parent | 2916b4038bb7f3ca203f32039145bc8cdd3bf735 (diff) | |
download | chromium_src-9a85f4cde6f4b702cb249768ba0a18dbc1766907.zip chromium_src-9a85f4cde6f4b702cb249768ba0a18dbc1766907.tar.gz chromium_src-9a85f4cde6f4b702cb249768ba0a18dbc1766907.tar.bz2 |
Fix alignment of avatar bubbles in the NTP
BUG=105014
TEST=
Review URL: http://codereview.chromium.org/8863009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113636 0039d316-1c4b-4281-b951-d872f2087c98
23 files changed, 80 insertions, 51 deletions
diff --git a/chrome/browser/chromeos/setting_level_bubble.cc b/chrome/browser/chromeos/setting_level_bubble.cc index 26f5a30..2f3b9ed 100644 --- a/chrome/browser/chromeos/setting_level_bubble.cc +++ b/chrome/browser/chromeos/setting_level_bubble.cc @@ -59,7 +59,7 @@ namespace chromeos { class SettingLevelBubbleDelegateView : public views::BubbleDelegateView { public: // BubbleDelegate overrides: - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; // Create the bubble delegate view. SettingLevelBubbleDelegateView(); @@ -77,15 +77,15 @@ class SettingLevelBubbleDelegateView : public views::BubbleDelegateView { DISALLOW_COPY_AND_ASSIGN(SettingLevelBubbleDelegateView); }; -gfx::Point SettingLevelBubbleDelegateView::GetAnchorPoint() { +gfx::Rect SettingLevelBubbleDelegateView::GetAnchorRect() { gfx::Size view_size = GetPreferredSize(); // Calculate the position in screen coordinates that the bubble should // "point" at (since we use BubbleBorder::FLOAT, this position actually // specifies the center of the bubble). gfx::Rect monitor_area = gfx::Screen::GetMonitorAreaNearestWindow(NULL); - return (gfx::Point( + return (gfx::Rect( monitor_area.x() + kBubbleXRatio * monitor_area.width(), - monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap)); + monitor_area.bottom() - view_size.height() / 2 - kBubbleBottomGap, 0, 0)); } SettingLevelBubbleDelegateView::SettingLevelBubbleDelegateView() diff --git a/chrome/browser/speech/speech_input_bubble_views.cc b/chrome/browser/speech/speech_input_bubble_views.cc index b8f24a0..8ece4d9 100644 --- a/chrome/browser/speech/speech_input_bubble_views.cc +++ b/chrome/browser/speech/speech_input_bubble_views.cc @@ -54,7 +54,7 @@ class SpeechInputBubbleView // views::BubbleDelegateView methods. virtual void OnWidgetActivationChanged(views::Widget* widget, bool active) OVERRIDE; - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; virtual void Init() OVERRIDE; // views::ButtonListener methods. @@ -108,14 +108,14 @@ void SpeechInputBubbleView::OnWidgetActivationChanged(views::Widget* widget, BubbleDelegateView::OnWidgetActivationChanged(widget, active); } -gfx::Point SpeechInputBubbleView::GetAnchorPoint() { +gfx::Rect SpeechInputBubbleView::GetAnchorRect() { gfx::Rect container_rect; tab_contents_->GetContainerBounds(&container_rect); gfx::Point anchor(container_rect.x() + element_rect_.CenterPoint().x(), container_rect.y() + element_rect_.bottom()); if (!container_rect.Contains(anchor)) - return BubbleDelegateView::GetAnchorPoint(); - return anchor; + return BubbleDelegateView::GetAnchorRect(); + return gfx::Rect(anchor, gfx::Size()); } void SpeechInputBubbleView::Init() { diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc index 9dda891..9f1b081 100644 --- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc +++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc @@ -459,8 +459,8 @@ void AvatarMenuBubbleView::LinkClicked(views::Link* source, int event_flags) { } } -gfx::Point AvatarMenuBubbleView::GetAnchorPoint() { - return gfx::Point(anchor_rect_.CenterPoint().x(), anchor_rect_.bottom()); +gfx::Rect AvatarMenuBubbleView::GetAnchorRect() { + return anchor_rect_; } void AvatarMenuBubbleView::Init() { diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.h b/chrome/browser/ui/views/avatar_menu_bubble_view.h index 5d4ce32..a1ac167 100644 --- a/chrome/browser/ui/views/avatar_menu_bubble_view.h +++ b/chrome/browser/ui/views/avatar_menu_bubble_view.h @@ -50,7 +50,7 @@ class AvatarMenuBubbleView : public views::BubbleDelegateView, virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; // BubbleDelegate implementation. - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; virtual void Init() OVERRIDE; // AvatarMenuModelObserver implementation. diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 8203423..ef4988a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc @@ -117,9 +117,11 @@ views::View* BookmarkBubbleView::GetInitiallyFocusedView() { return title_tf_; } -gfx::Point BookmarkBubbleView::GetAnchorPoint() { +gfx::Rect BookmarkBubbleView::GetAnchorRect() { // Compensate for some built-in padding in the star image. - return BubbleDelegateView::GetAnchorPoint().Subtract(gfx::Point(0, 5)); + gfx::Rect rect(BubbleDelegateView::GetAnchorRect()); + rect.Offset(0, -5); + return rect; } void BookmarkBubbleView::WindowClosing() { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h index ab4652d..b75266e 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h @@ -45,7 +45,7 @@ class BookmarkBubbleView : public views::BubbleDelegateView, // views::BubbleDelegateView methods. virtual views::View* GetInitiallyFocusedView() OVERRIDE; - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; // views::WidgetDelegate method. virtual void WindowClosing() OVERRIDE; diff --git a/chrome/browser/ui/views/confirm_bubble_view.cc b/chrome/browser/ui/views/confirm_bubble_view.cc index b0d8481..46f2044 100644 --- a/chrome/browser/ui/views/confirm_bubble_view.cc +++ b/chrome/browser/ui/views/confirm_bubble_view.cc @@ -48,8 +48,8 @@ void ConfirmBubbleView::LinkClicked(views::Link* source, int event_flags) { model_->LinkClicked(); } -gfx::Point ConfirmBubbleView::GetAnchorPoint() { - return anchor_point_; +gfx::Rect ConfirmBubbleView::GetAnchorRect() { + return gfx::Rect(anchor_point_, gfx::Size()); } void ConfirmBubbleView::Init() { diff --git a/chrome/browser/ui/views/confirm_bubble_view.h b/chrome/browser/ui/views/confirm_bubble_view.h index f0abdd3..6a03491 100644 --- a/chrome/browser/ui/views/confirm_bubble_view.h +++ b/chrome/browser/ui/views/confirm_bubble_view.h @@ -51,7 +51,7 @@ class ConfirmBubbleView : public views::BubbleDelegateView, virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; // views::BubbleDelegateView implementation. - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; virtual void Init() OVERRIDE; private: diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.cc b/chrome/browser/ui/views/content_setting_bubble_contents.cc index 7912881..08feea3 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.cc +++ b/chrome/browser/ui/views/content_setting_bubble_contents.cc @@ -133,8 +133,10 @@ gfx::Size ContentSettingBubbleContents::GetPreferredSize() { return preferred_size; } -gfx::Point ContentSettingBubbleContents::GetAnchorPoint() { - return BubbleDelegateView::GetAnchorPoint().Subtract(gfx::Point(0, 5)); +gfx::Rect ContentSettingBubbleContents::GetAnchorRect() { + gfx::Rect rect(BubbleDelegateView::GetAnchorRect()); + rect.Offset(0, -5); + return rect; } void ContentSettingBubbleContents::Init() { diff --git a/chrome/browser/ui/views/content_setting_bubble_contents.h b/chrome/browser/ui/views/content_setting_bubble_contents.h index 473de22..386684d 100644 --- a/chrome/browser/ui/views/content_setting_bubble_contents.h +++ b/chrome/browser/ui/views/content_setting_bubble_contents.h @@ -52,7 +52,7 @@ class ContentSettingBubbleContents : public views::BubbleDelegateView, virtual gfx::Size GetPreferredSize() OVERRIDE; // views::BubbleDelegateView: - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; protected: // views::BubbleDelegateView: diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc index c9feb3b..6012fae 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.cc +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.cc @@ -395,16 +395,17 @@ void ExtensionInstalledBubble::ShowInternal() { StartFade(true); } -gfx::Point ExtensionInstalledBubble::GetAnchorPoint() { +gfx::Rect ExtensionInstalledBubble::GetAnchorRect() { // For omnibox keyword bubbles, move the arrow to point to the left edge // of the omnibox, just to the right of the icon. if (type_ == OMNIBOX_KEYWORD) { LocationBarView* location_bar_view = BrowserView::GetBrowserViewForBrowser(browser_)->GetLocationBarView(); - return location_bar_view->GetLocationEntryOrigin().Add( - gfx::Point(0, location_bar_view->location_entry_view()->height())); + return gfx::Rect(location_bar_view->GetLocationEntryOrigin().Add( + gfx::Point(0, location_bar_view->location_entry_view()->height())), + gfx::Size()); } - return views::BubbleDelegateView::GetAnchorPoint(); + return views::BubbleDelegateView::GetAnchorRect(); } views::BubbleBorder::ArrowLocation diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble.h b/chrome/browser/ui/views/extensions/extension_installed_bubble.h index 0688659..e68d485 100644 --- a/chrome/browser/ui/views/extensions/extension_installed_bubble.h +++ b/chrome/browser/ui/views/extensions/extension_installed_bubble.h @@ -64,7 +64,7 @@ class ExtensionInstalledBubble virtual void WindowClosing() OVERRIDE; // views::BubbleDelegate - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; virtual views::BubbleBorder::ArrowLocation GetArrowLocation() const OVERRIDE; const Extension* extension_; diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index f4d9e91..20b4fd8 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -97,10 +97,11 @@ void FirstRunBubble::Init() { layout->AddView(label2); } -gfx::Point FirstRunBubble::GetAnchorPoint() { +gfx::Rect FirstRunBubble::GetAnchorRect() { // Compensate for padding in anchor. - return BubbleDelegateView::GetAnchorPoint().Add( - gfx::Point(0, anchor_view() ? kAnchorVerticalOffset : 0)); + gfx::Rect rect(BubbleDelegateView::GetAnchorRect()); + rect.Offset(0, anchor_view() ? kAnchorVerticalOffset : 0); + return rect; } FirstRunBubble::FirstRunBubble( diff --git a/chrome/browser/ui/views/first_run_bubble.h b/chrome/browser/ui/views/first_run_bubble.h index 5b92fa4c..0d5f830 100644 --- a/chrome/browser/ui/views/first_run_bubble.h +++ b/chrome/browser/ui/views/first_run_bubble.h @@ -22,7 +22,7 @@ class FirstRunBubble : public views::BubbleDelegateView, FirstRun::BubbleType bubble_type); // views::BubbleDelegateView overrides: - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; protected: // views::BubbleDelegateView overrides: diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 08f28db..f0363a9 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -2633,10 +2633,10 @@ void BrowserView::ShowAvatarBubble(TabContents* tab_contents, views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); gfx::Rect bounds(origin, rect.size()); - // TODO(msw): Set and support views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE. AvatarMenuBubbleView* bubble = new AvatarMenuBubbleView(this, views::BubbleBorder::TOP_RIGHT, bounds, browser_.get()); browser::CreateViewsBubble(bubble); + bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); bubble->Show(); } diff --git a/chrome/browser/ui/views/global_error_bubble_view.cc b/chrome/browser/ui/views/global_error_bubble_view.cc index 5b6c9bb..f173593 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.cc +++ b/chrome/browser/ui/views/global_error_bubble_view.cc @@ -123,9 +123,10 @@ GlobalErrorBubbleView::GlobalErrorBubbleView( GlobalErrorBubbleView::~GlobalErrorBubbleView() { } -gfx::Point GlobalErrorBubbleView::GetAnchorPoint() { - return (views::BubbleDelegateView::GetAnchorPoint().Add( - gfx::Point(0, anchor_view() ? kWrenchBubblePointOffsetY : 0))); +gfx::Rect GlobalErrorBubbleView::GetAnchorRect() { + gfx::Rect rect(views::BubbleDelegateView::GetAnchorRect()); + rect.Offset(0, anchor_view() ? kWrenchBubblePointOffsetY : 0); + return rect; } void GlobalErrorBubbleView::ButtonPressed(views::Button* sender, diff --git a/chrome/browser/ui/views/global_error_bubble_view.h b/chrome/browser/ui/views/global_error_bubble_view.h index 268f91c..868be51 100644 --- a/chrome/browser/ui/views/global_error_bubble_view.h +++ b/chrome/browser/ui/views/global_error_bubble_view.h @@ -22,7 +22,7 @@ class GlobalErrorBubbleView : public views::ButtonListener, virtual ~GlobalErrorBubbleView(); // views::BubbleDelegateView implementation. - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; // views::ButtonListener implementation. virtual void ButtonPressed(views::Button* sender, diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc index 0b32358..62188f9 100644 --- a/chrome/browser/ui/views/page_info_bubble_view.cc +++ b/chrome/browser/ui/views/page_info_bubble_view.cc @@ -295,10 +295,12 @@ void PageInfoBubbleView::OnPageInfoModelChanged() { #endif } -gfx::Point PageInfoBubbleView::GetAnchorPoint() { +gfx::Rect PageInfoBubbleView::GetAnchorRect() { // Compensate for some built-in padding in the icon. - gfx::Point anchor(BubbleDelegateView::GetAnchorPoint()); - return anchor_view() ? anchor.Subtract(gfx::Point(0, 5)) : anchor; + gfx::Rect anchor(BubbleDelegateView::GetAnchorRect()); + if (anchor_view()) + anchor.Offset(0, -5); + return anchor; } void PageInfoBubbleView::LinkClicked(views::Link* source, int event_flags) { diff --git a/chrome/browser/ui/views/page_info_bubble_view.h b/chrome/browser/ui/views/page_info_bubble_view.h index 8fd4bd5..2783451 100644 --- a/chrome/browser/ui/views/page_info_bubble_view.h +++ b/chrome/browser/ui/views/page_info_bubble_view.h @@ -34,7 +34,7 @@ class PageInfoBubbleView : public views::BubbleDelegateView, virtual void OnPageInfoModelChanged() OVERRIDE; // views::BubbleDelegate methods: - virtual gfx::Point GetAnchorPoint() OVERRIDE; + virtual gfx::Rect GetAnchorRect() OVERRIDE; // views::LinkListener methods: virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; diff --git a/ui/views/bubble/bubble_delegate.cc b/ui/views/bubble/bubble_delegate.cc index 1abae30..10aeddf 100644 --- a/ui/views/bubble/bubble_delegate.cc +++ b/ui/views/bubble/bubble_delegate.cc @@ -160,12 +160,12 @@ void BubbleDelegateView::OnWidgetActivationChanged(Widget* widget, } } -gfx::Point BubbleDelegateView::GetAnchorPoint() { +gfx::Rect BubbleDelegateView::GetAnchorRect() { if (!anchor_view()) - return gfx::Point(); + return gfx::Rect(); BubbleBorder::ArrowLocation location = GetArrowLocation(); - gfx::Point anchor(anchor_view()->bounds().CenterPoint()); + gfx::Point anchor; // By default, pick the middle of |anchor_view_|'s edge opposite the arrow. if (BubbleBorder::is_arrow_on_horizontal(location)) { anchor.SetPoint(anchor_view()->width() / 2, @@ -174,9 +174,11 @@ gfx::Point BubbleDelegateView::GetAnchorPoint() { anchor.SetPoint( BubbleBorder::is_arrow_on_left(location) ? anchor_view()->width() : 0, anchor_view_->height() / 2); + } else { + anchor = anchor_view()->bounds().CenterPoint(); } View::ConvertPointToScreen(anchor_view(), &anchor); - return anchor; + return gfx::Rect(anchor, gfx::Size()); } BubbleBorder::ArrowLocation BubbleDelegateView::GetArrowLocation() const { @@ -217,6 +219,11 @@ void BubbleDelegateView::ResetFade() { GetWidget()->SetOpacity(original_opacity_); } +void BubbleDelegateView::SetAlignment(BubbleBorder::BubbleAlignment alignment) { + GetBubbleFrameView()->bubble_border()->set_alignment(alignment); + SizeToContents(); +} + bool BubbleDelegateView::AcceleratorPressed( const ui::Accelerator& accelerator) { if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) @@ -278,8 +285,8 @@ BubbleFrameView* BubbleDelegateView::GetBubbleFrameView() const { gfx::Rect BubbleDelegateView::GetBubbleBounds() { // The argument rect has its origin at the bubble's arrow anchor point; // its size is the preferred size of the bubble's client view (this view). - return GetBubbleFrameView()->GetWindowBoundsForClientBounds( - gfx::Rect(GetAnchorPoint(), GetPreferredSize())); + return GetBubbleFrameView()->GetWindowBoundsForAnchorAndClientSize( + GetAnchorRect(), GetPreferredSize()); } #if defined(OS_WIN) && !defined(USE_AURA) diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_delegate.h index 3211a3e..01bd518 100644 --- a/ui/views/bubble/bubble_delegate.h +++ b/ui/views/bubble/bubble_delegate.h @@ -72,8 +72,8 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, use_focusless_ = use_focusless; } - // Get the arrow's anchor point in screen space. - virtual gfx::Point GetAnchorPoint(); + // Get the arrow's anchor rect in screen space. + virtual gfx::Rect GetAnchorRect(); // Get the arrow's location on the bubble. virtual BubbleBorder::ArrowLocation GetArrowLocation() const; @@ -89,6 +89,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView, // bubble to the setting before StartFade() was called. void ResetFade(); + // Sets the bubble alignment relative to the anchor. + void SetAlignment(BubbleBorder::BubbleAlignment alignment); + protected: // View overrides: virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index 11d1b20..4e73155 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc @@ -26,8 +26,8 @@ BubbleFrameView::BubbleFrameView(BubbleBorder::ArrowLocation location, bubble_border()->set_background_color(color); SetLayoutManager(new views::FillLayout()); AddChildView(border_contents_); - gfx::Rect bounds(gfx::Point(), client_size); - gfx::Rect windows_bounds = GetWindowBoundsForClientBounds(bounds); + gfx::Rect windows_bounds = + GetWindowBoundsForAnchorAndClientSize(gfx::Rect(), client_size); border_contents_->SetBoundsRect( gfx::Rect(gfx::Point(), windows_bounds.size())); SetBoundsRect(windows_bounds); @@ -48,14 +48,20 @@ gfx::Rect BubbleFrameView::GetBoundsForClientView() const { gfx::Rect BubbleFrameView::GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const { // The |client_bounds| origin is the bubble arrow anchor point. - gfx::Rect position_relative_to(client_bounds.origin(), gfx::Size()); + gfx::Rect anchor(client_bounds.origin(), gfx::Size()); // The |client_bounds| size is the bubble client view size. + return GetWindowBoundsForAnchorAndClientSize(anchor, client_bounds.size()); +} + +gfx::Rect BubbleFrameView::GetWindowBoundsForAnchorAndClientSize( + const gfx::Rect& anchor, + const gfx::Size& client_size) const { gfx::Rect content_bounds; gfx::Rect window_bounds; - border_contents_->SizeAndGetBounds(position_relative_to, + border_contents_->SizeAndGetBounds(anchor, location_, allow_bubble_offscreen_, - client_bounds.size(), + client_size, &content_bounds, &window_bounds); return window_bounds; diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h index 47861eb..5a8661d 100644 --- a/ui/views/bubble/bubble_frame_view.h +++ b/ui/views/bubble/bubble_frame_view.h @@ -41,6 +41,10 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView { // Accessor for bubble border inside border contents. BubbleBorder* bubble_border() const; + gfx::Rect GetWindowBoundsForAnchorAndClientSize( + const gfx::Rect& anchor, + const gfx::Size& client_size) const; + private: FRIEND_TEST_ALL_PREFIXES(BubbleFrameViewBasicTest, GetBoundsForClientView); |