diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 12:36:01 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 12:36:01 +0000 |
commit | 6c70e1efa665b0cbd13f79597de27ecca7fa4854 (patch) | |
tree | 76ac328f8111134d7698ae0fc92efc99039b3f49 /chrome/browser/views/pinned_contents_info_bubble.cc | |
parent | 41fa44caf6cf4e7c789af0db508ef64efb20a53d (diff) | |
download | chromium_src-6c70e1efa665b0cbd13f79597de27ecca7fa4854.zip chromium_src-6c70e1efa665b0cbd13f79597de27ecca7fa4854.tar.gz chromium_src-6c70e1efa665b0cbd13f79597de27ecca7fa4854.tar.bz2 |
Add ability to place bubble arrow on left and right side of the bubble or make it float with top edge.
BUG=crosbug.com/2800
TEST=Should be no visible changes with info bubble, everything should work as before. Bubble is used for example in bookmarking.
Review URL: http://codereview.chromium.org/1820002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/pinned_contents_info_bubble.cc')
-rw-r--r-- | chrome/browser/views/pinned_contents_info_bubble.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/views/pinned_contents_info_bubble.cc b/chrome/browser/views/pinned_contents_info_bubble.cc index a4edcf1..8f6c1636 100644 --- a/chrome/browser/views/pinned_contents_info_bubble.cc +++ b/chrome/browser/views/pinned_contents_info_bubble.cc @@ -5,15 +5,14 @@ #include "chrome/browser/views/pinned_contents_info_bubble.h" #include "chrome/browser/views/bubble_border.h" -#include "views/window/window.h" #if defined(OS_WIN) // BorderWidget --------------------------------------------------------------- void PinnedContentsBorderContents::SizeAndGetBounds( const gfx::Rect& position_relative_to, + BubbleBorder::ArrowLocation arrow_location, const gfx::Size& contents_size, - bool prefer_arrow_on_right, gfx::Rect* contents_bounds, gfx::Rect* window_bounds) { // Arrow offset is calculated from the middle of the |position_relative_to|. @@ -23,10 +22,10 @@ void PinnedContentsBorderContents::SizeAndGetBounds( gfx::Insets insets; bubble_border_->GetInsets(&insets); offset += kLeftMargin + insets.left() + 1; - bubble_border_->set_arrow_offset(offset); + bubble_border_->SetArrowOffset(offset, contents_size); BorderContents::SizeAndGetBounds( - position_relative_to, contents_size, prefer_arrow_on_right, + position_relative_to, arrow_location, contents_size, contents_bounds, window_bounds); // Now move the y position to make sure the bubble contents overlap the view. @@ -42,14 +41,16 @@ BorderContents* PinnedContentsBorderWidget::CreateBorderContents() { // static PinnedContentsInfoBubble* PinnedContentsInfoBubble::Show( - views::Window* parent, + views::Widget* parent, const gfx::Rect& position_relative_to, + BubbleBorder::ArrowLocation arrow_location, const gfx::Point& bubble_anchor, views::View* contents, InfoBubbleDelegate* delegate) { PinnedContentsInfoBubble* window = new PinnedContentsInfoBubble(bubble_anchor); - window->Init(parent, position_relative_to, contents, delegate); + window->Init(parent, position_relative_to, arrow_location, + contents, delegate); return window; } |