diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:46:03 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-15 22:46:03 +0000 |
commit | 413df1b5ebacf0f3bc2ad03020e9f93b92717803 (patch) | |
tree | 92381b78a0b3a1682523b338428688bd4e23cd9e | |
parent | 76665e75f3f10a3171efd3bebfbd9c59a7648a00 (diff) | |
download | chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.zip chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.gz chromium_src-413df1b5ebacf0f3bc2ad03020e9f93b92717803.tar.bz2 |
Convert the AutocompletePopupPositioner into a BubblePositioner in preparation for using it to position both the Omnibox bubble and InfoBubbles. It now gets the bounds of the location stack, which can be turned into useful coordinates for both items.
This should not result in any visible change.
BUG=21028
TEST=none
Review URL: http://codereview.chromium.org/194110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26288 0039d316-1c4b-4281-b951-d872f2087c98
32 files changed, 216 insertions, 181 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc index 26025e2..8e75865 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc @@ -82,7 +82,7 @@ AutocompleteEditViewGtk::AutocompleteEditViewGtk( Profile* profile, CommandUpdater* command_updater, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) : text_view_(NULL), tag_table_(NULL), text_buffer_(NULL), @@ -93,7 +93,7 @@ AutocompleteEditViewGtk::AutocompleteEditViewGtk( popup_view_(AutocompletePopupView::CreatePopupView(gfx::Font(), this, model_.get(), profile, - popup_positioner)), + bubble_positioner)), controller_(controller), toolbar_model_(toolbar_model), command_updater_(command_updater), diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h index 64fd6a2..aff1159 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h @@ -22,8 +22,8 @@ class AutocompleteEditController; class AutocompleteEditModel; -class AutocompletePopupPositioner; class AutocompletePopupView; +class BubblePositioner; class CommandUpdater; class Profile; class TabContents; @@ -52,7 +52,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView, Profile* profile, CommandUpdater* command_updater, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); ~AutocompleteEditViewGtk(); // Initialize, create the underlying widgets, etc. diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h index 45ce48b..53fe1ed 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h @@ -19,9 +19,9 @@ class AutocompleteEditController; @class AutocompleteEditHelper; class AutocompleteEditModel; -class AutocompletePopupPositioner; class AutocompletePopupViewMac; @class AutocompleteTextField; +class BubblePositioner; class Clipboard; class CommandUpdater; class Profile; @@ -33,7 +33,7 @@ class ToolbarModel; class AutocompleteEditViewMac : public AutocompleteEditView { public: AutocompleteEditViewMac(AutocompleteEditController* controller, - AutocompletePopupPositioner* positioner, + const BubblePositioner* bubble_positioner, ToolbarModel* toolbar_model, Profile* profile, CommandUpdater* command_updater, diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 00485f5..8865144 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -139,14 +139,14 @@ NSRange ComponentToNSRange(const url_parse::Component& component) { // the window |field_| is in. AutocompleteEditViewMac::AutocompleteEditViewMac( AutocompleteEditController* controller, - AutocompletePopupPositioner* positioner, + const BubblePositioner* bubble_positioner, ToolbarModel* toolbar_model, Profile* profile, CommandUpdater* command_updater, AutocompleteTextField* field) : model_(new AutocompleteEditModel(this, controller, profile)), - popup_view_(new AutocompletePopupViewMac(this, model_.get(), positioner, - profile, field)), + popup_view_(new AutocompletePopupViewMac( + this, model_.get(), bubble_positioner, profile, field)), controller_(controller), toolbar_model_(toolbar_model), command_updater_(command_updater), diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index eb7ae14..e6643f3 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -391,12 +391,10 @@ AutocompleteEditViewWin::AutocompleteEditViewWin( Profile* profile, CommandUpdater* command_updater, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) : model_(new AutocompleteEditModel(this, controller, profile)), - popup_view_(AutocompletePopupView::CreatePopupView(font, this, - model_.get(), - profile, - popup_positioner)), + popup_view_(AutocompletePopupView::CreatePopupView( + font, this, model_.get(), profile, bubble_positioner)), controller_(controller), parent_view_(parent_view), toolbar_model_(toolbar_model), diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h index a66583f..8946c4c 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h @@ -69,7 +69,7 @@ class AutocompleteEditViewWin Profile* profile, CommandUpdater* command_updater, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); ~AutocompleteEditViewWin(); views::View* parent_view() const { return parent_view_; } diff --git a/chrome/browser/autocomplete/autocomplete_popup_view.h b/chrome/browser/autocomplete/autocomplete_popup_view.h index 0dc8e35..57670c5 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,9 +15,9 @@ class AutocompleteEditView; class AutocompletePopupModel; +class BubblePositioner; namespace gfx { class Font; -class Rect; } #if defined(OS_WIN) || defined(OS_LINUX) class AutocompleteEditViewWin; @@ -25,18 +25,6 @@ class AutocompleteEditModel; class Profile; #endif -// An object in the browser UI can implement this interface to provide display -// bounds for the autocomplete popup view. -class AutocompletePopupPositioner { - public: - virtual ~AutocompletePopupPositioner() { } - - // Returns the bounds at which the popup should be shown, in screen - // coordinates. The height is ignored, since the popup is sized to its - // contents automatically. - virtual gfx::Rect GetPopupBounds() const = 0; -}; - class AutocompletePopupView { public: virtual ~AutocompletePopupView() { } @@ -65,7 +53,7 @@ class AutocompletePopupView { AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); #endif }; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc index fb98795..5c0b56c 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.cc @@ -20,6 +20,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" +#include "chrome/browser/bubble_positioner.h" #include "chrome/browser/defaults.h" #include "chrome/browser/profile.h" #include "chrome/browser/search_engines/template_url.h" @@ -242,10 +243,10 @@ AutocompletePopupViewGtk::AutocompletePopupViewGtk( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) : model_(new AutocompletePopupModel(this, edit_model, profile)), edit_view_(edit_view), - popup_positioner_(popup_positioner), + bubble_positioner_(bubble_positioner), window_(gtk_window_new(GTK_WINDOW_POPUP)), layout_(NULL), opened_(false) { @@ -335,7 +336,8 @@ AutocompletePopupModel* AutocompletePopupViewGtk::GetModel() { } void AutocompletePopupViewGtk::Show(size_t num_results) { - gfx::Rect rect = popup_positioner_->GetPopupBounds(); + gfx::Rect rect = bubble_positioner_->GetLocationStackBounds(); + rect.set_y(rect.bottom()); rect.set_height((num_results * kHeightPerResult) + (kBorderThickness * 2)); gtk_window_move(GTK_WINDOW(window_), rect.x(), rect.y()); @@ -509,7 +511,7 @@ AutocompletePopupView* AutocompletePopupView::CreatePopupView( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) { + const BubblePositioner* bubble_positioner) { return new AutocompletePopupViewGtk(edit_view, edit_model, profile, - popup_positioner); + bubble_positioner); } diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h index 4125791..eed6182 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h @@ -23,7 +23,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView { AutocompletePopupViewGtk(AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); ~AutocompletePopupViewGtk(); // Implement the AutocompletePopupView interface. @@ -75,7 +75,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView { scoped_ptr<AutocompletePopupModel> model_; AutocompleteEditView* edit_view_; - AutocompletePopupPositioner* popup_positioner_; + const BubblePositioner* bubble_positioner_; // Our popup window, which is the only widget used, and we paint it on our // own. This widget shouldn't be exposed outside of this class. diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h index 7840dfe..2dddd70 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.h +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.h @@ -33,7 +33,7 @@ class AutocompletePopupViewMac : public AutocompletePopupView { public: AutocompletePopupViewMac(AutocompleteEditViewMac* edit_view, AutocompleteEditModel* edit_model, - AutocompletePopupPositioner* positioner, + const BubblePositioner* bubble_positioner, Profile* profile, NSTextField* field); virtual ~AutocompletePopupViewMac(); @@ -99,7 +99,7 @@ class AutocompletePopupViewMac : public AutocompletePopupView { scoped_ptr<AutocompletePopupModel> model_; AutocompleteEditViewMac* edit_view_; - AutocompletePopupPositioner* positioner_; // owned by toolbar controller + const BubblePositioner* bubble_positioner_; // owned by toolbar controller NSTextField* field_; // owned by tab controller scoped_nsobject<AutocompleteMatrixTarget> matrix_target_; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 943fc0a..6e468af 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -10,6 +10,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" +#include "chrome/browser/bubble_positioner.h" #include "chrome/browser/cocoa/event_utils.h" #include "chrome/browser/cocoa/nsimage_cache.h" @@ -259,12 +260,12 @@ NSAttributedString* AutocompletePopupViewMac::MatchText( AutocompletePopupViewMac::AutocompletePopupViewMac( AutocompleteEditViewMac* edit_view, AutocompleteEditModel* edit_model, - AutocompletePopupPositioner* positioner, + const BubblePositioner* bubble_positioner, Profile* profile, NSTextField* field) : model_(new AutocompletePopupModel(this, edit_model, profile)), edit_view_(edit_view), - positioner_(positioner), + bubble_positioner_(bubble_positioner), field_(field), matrix_target_([[AutocompleteMatrixTarget alloc] initWithPopupView:this]), popup_(nil) { @@ -345,7 +346,8 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() { CreatePopupIfNeeded(); // Layout the popup and size it to land underneath the field. - NSRect r = NSRectFromCGRect(positioner_->GetPopupBounds().ToCGRect()); + NSRect r = + NSRectFromCGRect(bubble_positioner_->GetLocationStackBounds().ToCGRect()); r.origin = [[field_ window] convertBaseToScreen:r.origin]; DCHECK_GT(r.size.width, 0.0); diff --git a/chrome/browser/bubble_positioner.h b/chrome/browser/bubble_positioner.h new file mode 100644 index 0000000..5336b1b --- /dev/null +++ b/chrome/browser/bubble_positioner.h @@ -0,0 +1,22 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_BUBBLE_POSITIONER_H_ +#define CHROME_BROWSER_BUBBLE_POSITIONER_H_ + +namespace gfx { +class Rect; +} + +// An object in the browser UI can implement this interface to provide display +// bounds for the omnibox bubble. +class BubblePositioner { + public: + // Returns the bounds of the "location bar" stack (including star/go buttons + // where relevant). The omnibox dropdown uses this to calculate its width and + // y-coordinate. + virtual gfx::Rect GetLocationStackBounds() const = 0; +}; + +#endif // CHROME_BROWSER_BUBBLE_POSITIONER_H_ diff --git a/chrome/browser/chromeos/compact_navigation_bar.cc b/chrome/browser/chromeos/compact_navigation_bar.cc index b68ae41..35fafc3 100644 --- a/chrome/browser/chromeos/compact_navigation_bar.cc +++ b/chrome/browser/chromeos/compact_navigation_bar.cc @@ -199,10 +199,10 @@ std::wstring CompactNavigationBar::GetTitle() const { return std::wstring(); } -gfx::Rect CompactNavigationBar::GetPopupBounds() const { - gfx::Point upper_left(0, height()); - ConvertPointToScreen(this, &upper_left); - return gfx::Rect(upper_left.x(), upper_left.y(), 700, 100); +gfx::Rect CompactNavigationBar::GetLocationStackBounds() const { + gfx::Point origin; + ConvertPointToScreen(this, &origin); + return gfx::Rect(origin, size()); } void CompactNavigationBar::AddTabWithURL(const GURL& url, diff --git a/chrome/browser/chromeos/compact_navigation_bar.h b/chrome/browser/chromeos/compact_navigation_bar.h index ce3cd5f..a0553bd 100644 --- a/chrome/browser/chromeos/compact_navigation_bar.h +++ b/chrome/browser/chromeos/compact_navigation_bar.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" -#include "chrome/browser/autocomplete/autocomplete_popup_view.h" +#include "chrome/browser/bubble_positioner.h" #include "views/controls/button/button.h" #include "views/view.h" @@ -26,7 +26,7 @@ class NativeViewHost; class CompactNavigationBar : public views::View, public views::ButtonListener, public AutocompleteEditController, - public AutocompletePopupPositioner { + public BubblePositioner { public: explicit CompactNavigationBar(Browser* browser); virtual ~CompactNavigationBar(); @@ -55,8 +55,8 @@ class CompactNavigationBar : public views::View, virtual SkBitmap GetFavIcon() const; virtual std::wstring GetTitle() const; - // AutocompletePopupPositioner implementation. - virtual gfx::Rect GetPopupBounds() const; + // BubblePositioner: + virtual gfx::Rect GetLocationStackBounds() const; void AddTabWithURL(const GURL& url, PageTransition::Type transition); diff --git a/chrome/browser/cocoa/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar_view_mac.h index f04b11e..d765a83 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.h +++ b/chrome/browser/cocoa/location_bar_view_mac.h @@ -13,8 +13,8 @@ #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" #include "chrome/browser/location_bar.h" -class AutocompletePopupPositioner; @class AutocompleteTextField; +class BubblePositioner; class CommandUpdater; class Profile; class ToolbarModel; @@ -28,7 +28,7 @@ class LocationBarViewMac : public AutocompleteEditController, public LocationBarTesting { public: LocationBarViewMac(AutocompleteTextField* field, - AutocompletePopupPositioner* positioner, + const BubblePositioner* bubble_positioner, CommandUpdater* command_updater, ToolbarModel* toolbar_model, Profile* profile); diff --git a/chrome/browser/cocoa/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar_view_mac.mm index bbf8a66..42262ee 100644 --- a/chrome/browser/cocoa/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar_view_mac.mm @@ -45,13 +45,14 @@ std::wstring GetKeywordName(Profile* profile, const std::wstring& keyword) { } // namespace -LocationBarViewMac::LocationBarViewMac(AutocompleteTextField* field, - AutocompletePopupPositioner* positioner, - CommandUpdater* command_updater, - ToolbarModel* toolbar_model, - Profile* profile) - : edit_view_(new AutocompleteEditViewMac(this, positioner, toolbar_model, - profile, command_updater, field)), +LocationBarViewMac::LocationBarViewMac( + AutocompleteTextField* field, + const BubblePositioner* bubble_positioner, + CommandUpdater* command_updater, + ToolbarModel* toolbar_model, + Profile* profile) + : edit_view_(new AutocompleteEditViewMac(this, bubble_positioner, + toolbar_model, profile, command_updater, field)), command_updater_(command_updater), field_(field), disposition_(CURRENT_TAB), diff --git a/chrome/browser/cocoa/toolbar_controller.h b/chrome/browser/cocoa/toolbar_controller.h index d86b1fc..f61822f 100644 --- a/chrome/browser/cocoa/toolbar_controller.h +++ b/chrome/browser/cocoa/toolbar_controller.h @@ -15,16 +15,16 @@ #import "chrome/browser/cocoa/view_resizer.h" #include "chrome/common/pref_member.h" -class AutocompletePopupPositioner; @class AutocompleteTextField; @class AutocompleteTextFieldEditor; @class BackForwardMenuController; -@class DelayedMenuButton; -@class MenuButton; class Browser; +class BubblePositioner; class CommandUpdater; +@class DelayedMenuButton; class LocationBar; class LocationBarViewMac; +@class MenuButton; namespace ToolbarControllerInternal { class PrefObserverBridge; } @@ -35,7 +35,7 @@ class ToolbarView; // A controller for the toolbar in the browser window. Manages // updating the state for location bar and back/fwd/reload/go buttons. -// Manages the bookmark bar and it's position in the window relative to +// Manages the bookmark bar and its position in the window relative to // the web content view. @interface ToolbarController : @@ -56,8 +56,8 @@ class ToolbarView; // Used for monitoring the optional toolbar button prefs. scoped_ptr<ToolbarControllerInternal::PrefObserverBridge> prefObserver_; - // Used to positioner the omnibox popup view. - scoped_ptr<AutocompletePopupPositioner> popupPositioner_; + // Used to position the omnibox bubble. + scoped_ptr<BubblePositioner> bubblePositioner_; BooleanPrefMember showHomeButton_; BooleanPrefMember showPageOptionButtons_; BOOL hasToolbar_; // if NO, we only have the location bar. @@ -146,7 +146,7 @@ class ToolbarView; - (NSArray*)toolbarViews; - (void)showOptionalHomeButton; - (void)showOptionalPageWrenchButtons; -- (gfx::Rect)autocompletePopupPosition; +- (gfx::Rect)locationStackBounds; // Return a hover button for the current event. - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent; @end diff --git a/chrome/browser/cocoa/toolbar_controller.mm b/chrome/browser/cocoa/toolbar_controller.mm index c7c0ad3..65350f7 100644 --- a/chrome/browser/cocoa/toolbar_controller.mm +++ b/chrome/browser/cocoa/toolbar_controller.mm @@ -10,7 +10,7 @@ #include "base/gfx/rect.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.h" -#include "chrome/browser/autocomplete/autocomplete_popup_view.h" +#include "chrome/browser/bubble_positioner.h" #import "chrome/browser/cocoa/autocomplete_text_field.h" #import "chrome/browser/cocoa/autocomplete_text_field_editor.h" #import "chrome/browser/cocoa/back_forward_menu_controller.h" @@ -44,16 +44,16 @@ static const float kBookmarkBarOverlap = 7.0; namespace { -// A C++ class used to correctly position the autocomplete popup. -class AutocompletePopupPositionerMac : public AutocompletePopupPositioner { +// A C++ class used to correctly position the omnibox. +class BubblePositionerMac : public BubblePositioner { public: - AutocompletePopupPositionerMac(ToolbarController* controller) + BubblePositionerMac(ToolbarController* controller) : controller_(controller) { } - virtual ~AutocompletePopupPositionerMac() { } + virtual ~BubblePositionerMac() { } - // Overridden from AutocompletePopupPositioner. - virtual gfx::Rect GetPopupBounds() const { - return [controller_ autocompletePopupPosition]; + // BubblePositioner: + virtual gfx::Rect GetLocationStackBounds() const { + return [controller_ locationStackBounds]; } private: @@ -128,9 +128,9 @@ class PrefObserverBridge : public NotificationObserver { // bar and button state. - (void)awakeFromNib { [self initCommandStatus:commands_]; - popupPositioner_.reset(new AutocompletePopupPositionerMac(self)); + bubblePositioner_.reset(new BubblePositionerMac(self)); locationBarView_.reset(new LocationBarViewMac(locationBar_, - popupPositioner_.get(), + bubblePositioner_.get(), commands_, toolbarModel_, profile_)); [locationBar_ setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]]; @@ -514,19 +514,25 @@ class PrefObserverBridge : public NotificationObserver { } -- (gfx::Rect)autocompletePopupPosition { - // The popup should span from the left edge of the star button to the right - // edge of the go button. The returned height is ignored. +- (gfx::Rect)locationStackBounds { + // The number of pixels from the left or right edges of the location stack to + // "just inside the visible borders". When the omnibox bubble contents are + // aligned with this, the visible borders tacked on to the outsides will line + // up with the visible borders on the location stack. + const int kLocationStackEdgeWidth = 2; + NSRect locationFrame = [locationBar_ frame]; - // TODO(shess): The buttons have an extra 2 pixels between the edge - // of the visual button and the edge of the logical button. This - // seems wrong. - int minX = NSMinX([starButton_ frame]) + 2.0; - int maxX = NSMaxX([goButton_ frame]) - 2.0; + int minX = NSMinX([starButton_ frame]); + int maxX = NSMaxX([goButton_ frame]); DCHECK(minX < NSMinX(locationFrame)); DCHECK(maxX > NSMaxX(locationFrame)); - NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, 0); - return gfx::Rect(NSRectToCGRect([[self view] convertRect:r toView:nil])); + NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, + NSHeight(locationFrame)); + gfx::Rect stack_bounds( + NSRectToCGRect([[self view] convertRect:r toView:nil])); + // Inset the bounds to just inside the visible edges (see comment above). + stack_bounds.Inset(kLocationStackEdgeWidth, 0); + return stack_bounds; } @end diff --git a/chrome/browser/cocoa/toolbar_controller_unittest.mm b/chrome/browser/cocoa/toolbar_controller_unittest.mm index 21f9e61..9ba3236 100644 --- a/chrome/browser/cocoa/toolbar_controller_unittest.mm +++ b/chrome/browser/cocoa/toolbar_controller_unittest.mm @@ -273,7 +273,7 @@ TEST_F(ToolbarControllerTest, StarButtonInWindowCoordinates) { EXPECT_TRUE(NSContainsRect(all, star)); } -TEST_F(ToolbarControllerTest, AutocompletePopupPosition) { +TEST_F(ToolbarControllerTest, BubblePosition) { NSView* locationBar = [[bar_ toolbarViews] objectAtIndex:kLocationIndex]; // The window frame (in window base coordinates). @@ -281,17 +281,14 @@ TEST_F(ToolbarControllerTest, AutocompletePopupPosition) { // The frame of the location bar in window base coordinates. NSRect locationFrame = [locationBar convertRect:[locationBar bounds] toView:nil]; - // The frame of the popup in window base coordinates. - gfx::Rect popupFrame = [bar_ autocompletePopupPosition]; - - // Make sure the popup starts to the left of and ends to the right of the - // location bar. - EXPECT_LT(popupFrame.x(), NSMinX(locationFrame)); - EXPECT_GT(popupFrame.right(), NSMaxX(locationFrame)); - - // Make sure the popup frame is positioned above the bottom of the - // location bar. - EXPECT_GE(popupFrame.bottom(), NSMinY(locationFrame)); + // The frame of the location stack in window base coordinates. The horizontal + // coordinates here are used for the omnibox dropdown. + gfx::Rect locationStackFrame = [bar_ locationStackBounds]; + + // Make sure the location stack starts to the left of and ends to the right of + // the location bar. + EXPECT_LT(locationStackFrame.x(), NSMinX(locationFrame)); + EXPECT_GT(locationStackFrame.right(), NSMaxX(locationFrame)); } TEST_F(ToolbarControllerTest, HoverButtonForEvent) { diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index 836f307..0a0aad3 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -61,15 +61,6 @@ const int kToolbarHeightLocationBarOnly = kToolbarHeight - 2; // Interior spacing between toolbar widgets. const int kToolbarWidgetSpacing = 4; -// The amount of space between the bottom of the star and the top of the -// Omnibox results popup window. We want a two pixel space between the bottom -// and the results, but have some extra space below the buttons already. -const int kPopupTopMargin = 0; - -// Space between the edge of the star/go button and the popup frame. We want -// to leave 1 pixel on both side here so that the borders line up. -const int kPopupLeftRightMargin = 1; - // The color used as the base[] color of the location entry during a secure // connection. const GdkColor kSecureColor = GDK_COLOR_RGB(255, 245, 195); @@ -425,7 +416,13 @@ void BrowserToolbarGtk::UpdateTabContents(TabContents* contents, location_bar_->Update(should_restore_state ? contents : NULL); } -gfx::Rect BrowserToolbarGtk::GetPopupBounds() const { +gfx::Rect BrowserToolbarGtk::GetLocationStackBounds() const { + // The number of pixels from the left or right edges of the location stack to + // "just inside the visible borders". When the omnibox bubble contents are + // aligned with this, the visible borders tacked on to the outsides will line + // up with the visible borders on the location stack. + const int kLocationStackEdgeWidth = 1; + GtkWidget* left; GtkWidget* right; if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) { @@ -441,16 +438,14 @@ gfx::Rect BrowserToolbarGtk::GetPopupBounds() const { gdk_window_get_origin(left->window, &origin_x, &origin_y); gint right_x = origin_x + right->allocation.x + right->allocation.width; - gint left_x = origin_x + left->allocation.x; - - // Bottom edge. - gint left_y = origin_y + left->allocation.y + left->allocation.height; - DCHECK_LE(left_x, right_x); - return gfx::Rect(left_x + kPopupLeftRightMargin, left_y + kPopupTopMargin, - right_x - left_x - (2 * kPopupLeftRightMargin), 0); + gfx::Rect stack_bounds(left_x, origin_y + left->allocation.y, + right_x - left_x, left->allocation.height); + // Inset the bounds to just inside the visible edges (see comment above). + stack_bounds.Inset(kLocationStackEdgeWidth, 0); + return stack_bounds; } // BrowserToolbarGtk, private -------------------------------------------------- diff --git a/chrome/browser/gtk/browser_toolbar_gtk.h b/chrome/browser/gtk/browser_toolbar_gtk.h index 07f0173..74b2a48 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.h +++ b/chrome/browser/gtk/browser_toolbar_gtk.h @@ -9,7 +9,7 @@ #include <string> #include "base/scoped_ptr.h" -#include "chrome/browser/autocomplete/autocomplete_popup_view.h" +#include "chrome/browser/bubble_positioner.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/gtk/menu_bar_helper.h" #include "chrome/browser/gtk/menu_gtk.h" @@ -35,7 +35,7 @@ class ToolbarStarToggleGtk; class BrowserToolbarGtk : public CommandUpdater::CommandObserver, public MenuGtk::Delegate, public NotificationObserver, - public AutocompletePopupPositioner, + public BubblePositioner, public MenuBarHelper::Delegate { public: explicit BrowserToolbarGtk(Browser* browser, BrowserWindowGtk* window); @@ -87,9 +87,8 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, ToolbarStarToggleGtk* star() { return star_.get(); } - // Implement AutocompletePopupPositioner, return the position of where the - // Omnibox results popup should go (from the star to the go buttons). - virtual gfx::Rect GetPopupBounds() const; + // BubblePositioner: + virtual gfx::Rect GetLocationStackBounds() const; // MenuBarHelper::Delegate implementation ------------------------------------ virtual void PopupForButton(GtkWidget* button); diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index c2b85a2..2364ab3 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -102,8 +102,10 @@ const GdkColor LocationBarViewGtk::kBackgroundColorByLevel[3] = { GDK_COLOR_RGB(255, 255, 255), // SecurityLevel INSECURE: White. }; -LocationBarViewGtk::LocationBarViewGtk(CommandUpdater* command_updater, - ToolbarModel* toolbar_model, AutocompletePopupPositioner* popup_positioner, +LocationBarViewGtk::LocationBarViewGtk( + CommandUpdater* command_updater, + ToolbarModel* toolbar_model, + const BubblePositioner* bubble_positioner, Browser* browser) : security_icon_event_box_(NULL), security_lock_icon_image_(NULL), @@ -119,7 +121,7 @@ LocationBarViewGtk::LocationBarViewGtk(CommandUpdater* command_updater, command_updater_(command_updater), toolbar_model_(toolbar_model), browser_(browser), - popup_positioner_(popup_positioner), + bubble_positioner_(bubble_positioner), disposition_(CURRENT_TAB), transition_(PageTransition::TYPED), first_run_bubble_(this), @@ -139,7 +141,7 @@ void LocationBarViewGtk::Init(bool popup_window_mode) { profile_, command_updater_, popup_window_mode_, - popup_positioner_)); + bubble_positioner_)); location_entry_->Init(); hbox_.Own(gtk_hbox_new(FALSE, kInnerPadding)); diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index 3605027..541126e 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -24,7 +24,7 @@ #include "webkit/glue/window_open_disposition.h" class AutocompleteEditViewGtk; -class AutocompletePopupPositioner; +class BubblePositioner; class Browser; class CommandUpdater; class GtkThemeProvider; @@ -41,7 +41,7 @@ class LocationBarViewGtk : public AutocompleteEditController, public: LocationBarViewGtk(CommandUpdater* command_updater, ToolbarModel* toolbar_model, - AutocompletePopupPositioner* popup_positioner, + const BubblePositioner* bubble_positioner, Browser* browser_); virtual ~LocationBarViewGtk(); @@ -210,7 +210,7 @@ class LocationBarViewGtk : public AutocompleteEditController, Browser* browser_; // We need to hold on to this just to it pass to the edit. - AutocompletePopupPositioner* popup_positioner_; + const BubblePositioner* bubble_positioner_; // When we get an OnAutocompleteAccept notification from the autocomplete // edit, we save the input string so we can give it back to the browser on diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc index 2ca8f0d..7efee67 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc @@ -14,6 +14,7 @@ #include "base/compiler_specific.h" #include "chrome/browser/autocomplete/autocomplete_edit_view.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" +#include "chrome/browser/bubble_positioner.h" #include "chrome/browser/views/bubble_border.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" @@ -582,7 +583,7 @@ AutocompletePopupContentsView::AutocompletePopupContentsView( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) #if defined(OS_WIN) : popup_(new AutocompletePopupWin(this)), #else @@ -590,10 +591,14 @@ AutocompletePopupContentsView::AutocompletePopupContentsView( #endif model_(new AutocompletePopupModel(this, edit_model, profile)), edit_view_(edit_view), - popup_positioner_(popup_positioner), + bubble_positioner_(bubble_positioner), result_font_(font.DeriveFont(kEditFontAdjust)), ALLOW_THIS_IN_INITIALIZER_LIST(size_animation_(this)) { - set_border(new BubbleBorder); + // The following little dance is required because set_border() requires a + // pointer to a non-const object. + BubbleBorder* bubble_border = new BubbleBorder; + bubble_border_ = bubble_border; + set_border(bubble_border); } gfx::Rect AutocompletePopupContentsView::GetPopupBounds() const { @@ -650,12 +655,10 @@ void AutocompletePopupContentsView::UpdatePopupAppearance() { } // Calculate desired bounds. - gfx::Rect new_target_bounds = popup_positioner_->GetPopupBounds(); - new_target_bounds.set_height(total_child_height); - gfx::Insets insets; - border()->GetInsets(&insets); - new_target_bounds.Inset(-insets.left(), -insets.top(), -insets.right(), - -insets.bottom()); + gfx::Rect location_stack_bounds = + bubble_positioner_->GetLocationStackBounds(); + gfx::Rect new_target_bounds(bubble_border_->GetBounds(location_stack_bounds, + gfx::Size(location_stack_bounds.width(), total_child_height))); // If we're animating and our target height changes, reset the animation. // NOTE: If we just reset blindly on _every_ update, then when the user types @@ -870,7 +873,7 @@ AutocompletePopupView* AutocompletePopupView::CreatePopupView( AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner) { + const BubblePositioner* bubble_positioner) { return new AutocompletePopupContentsView(font, edit_view, edit_model, - profile, popup_positioner); + profile, bubble_positioner); } diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h index b8baf1b..d5f710e 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h @@ -55,7 +55,7 @@ class AutocompletePopupContentsView : public views::View, AutocompleteEditView* edit_view, AutocompleteEditModel* edit_model, Profile* profile, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); virtual ~AutocompletePopupContentsView() {} // Returns the bounds the popup should be shown at. This is the display bounds @@ -117,7 +117,10 @@ class AutocompletePopupContentsView : public views::View, AutocompleteEditView* edit_view_; // An object that tells the popup how to position itself. - AutocompletePopupPositioner* popup_positioner_; + const BubblePositioner* bubble_positioner_; + + // Our border, which can compute our desired bounds. + const BubbleBorder* bubble_border_; // The font that we should use for result rows. This is based on the font used // by the edit that created us. diff --git a/chrome/browser/views/bubble_border.cc b/chrome/browser/views/bubble_border.cc index eaf27c1..8bf0170 100644 --- a/chrome/browser/views/bubble_border.cc +++ b/chrome/browser/views/bubble_border.cc @@ -21,10 +21,27 @@ SkBitmap* BubbleBorder::bottom_right_ = NULL; SkBitmap* BubbleBorder::bottom_ = NULL; SkBitmap* BubbleBorder::bottom_left_ = NULL; +gfx::Rect BubbleBorder::GetBounds(const gfx::Rect& position_relative_to, + const gfx::Size& contents_size) const { + // The spacing (in pixels) between |position_relative_to| and the bubble + // content. + const int kBubbleSpacing = 2; + + // Desired size is size of contents enlarged by the size of the border images. + gfx::Size border_size(contents_size); + gfx::Insets insets; + GetInsets(&insets); + border_size.Enlarge(insets.left() + insets.right(), + insets.top() + insets.bottom()); + + int x = position_relative_to.x() + (position_relative_to.width() / 2) - + (contents_size.width() / 2) - insets.left(); + int y = position_relative_to.bottom() - (top_->height() - kBubbleSpacing); + + return gfx::Rect(x, y, border_size.width(), border_size.height()); +} + void BubbleBorder::GetInsets(gfx::Insets* insets) const { - // The left, right and bottom edge image sizes define our insets. The corner - // images don't determine this because they can extend inside the border (onto - // the contained contents). insets->Set(top_->height(), left_->width(), bottom_->height(), right_->width()); } @@ -109,6 +126,7 @@ void BubbleBorder::Paint(const views::View& view, gfx::Canvas* canvas) const { // Bottom edge canvas->TileImageInt(*bottom_, bl_width, bottom, width - bl_width - br_width, b_height); + // Bottom left corner canvas->DrawBitmapInt(*bottom_left_, 0, bl_y); diff --git a/chrome/browser/views/bubble_border.h b/chrome/browser/views/bubble_border.h index 2febe83..7b0ee47 100644 --- a/chrome/browser/views/bubble_border.h +++ b/chrome/browser/views/bubble_border.h @@ -27,6 +27,12 @@ class BubbleBorder : public views::Border { return 4; } + // Gives the desired bounds (in screen coordinates) given the rect to position + // relative to and the size of the contained contents. The contents are + // centered underneath the supplied rect. + gfx::Rect GetBounds(const gfx::Rect& position_relative_to, + const gfx::Size& contents_size) const; + // Overridden from views::Border: virtual void GetInsets(gfx::Insets* insets) const; diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index b607c06..267423b 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -86,7 +86,7 @@ LocationBarView::LocationBarView(Profile* profile, ToolbarModel* model, Delegate* delegate, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner) + const BubblePositioner* bubble_positioner) : profile_(profile), command_updater_(command_updater), model_(model), @@ -99,7 +99,7 @@ LocationBarView::LocationBarView(Profile* profile, security_image_view_(profile, model), popup_window_mode_(popup_window_mode), first_run_bubble_(this), - popup_positioner_(popup_positioner) { + bubble_positioner_(bubble_positioner) { DCHECK(profile_); SetID(VIEW_ID_LOCATION_BAR); SetFocusable(true); @@ -138,12 +138,12 @@ void LocationBarView::Init() { widget->GetNativeView(), profile_, command_updater_, popup_window_mode_, - popup_positioner_)); + bubble_positioner_)); #else location_entry_.reset(new AutocompleteEditViewGtk(this, model_, profile_, command_updater_, popup_window_mode_, - popup_positioner_)); + bubble_positioner_)); location_entry_->Init(); // Make all the children of the widget visible. NOTE: this won't display // anything, it just toggles the visible flag. diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index a9e0a54..b72eca5 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -27,7 +27,7 @@ #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" #endif -class AutocompletePopupPositioner; +class BubblePositioner; class CommandUpdater; class GURL; class PageAction; @@ -73,7 +73,7 @@ class LocationBarView : public LocationBar, ToolbarModel* model, Delegate* delegate, bool popup_window_mode, - AutocompletePopupPositioner* popup_positioner); + const BubblePositioner* bubble_positioner); virtual ~LocationBarView(); void Init(); @@ -339,9 +339,9 @@ class LocationBarView : public LocationBar, class PageActionImageView : public LocationBarImageView, public ImageLoadingTracker::Observer { public: - PageActionImageView( - LocationBarView* owner, Profile* profile, - const PageAction* page_action); + PageActionImageView(LocationBarView* owner, + Profile* profile, + const PageAction* page_action); virtual ~PageActionImageView(); // Overridden from view for the mouse hovering. @@ -518,8 +518,8 @@ class LocationBarView : public LocationBar, // Used schedule a task for the first run info bubble. ScopedRunnableMethodFactory<LocationBarView> first_run_bubble_; - // The positioner that places the autocomplete popup. - AutocompletePopupPositioner* popup_positioner_; + // The positioner that places the omnibox and info bubbles. + const BubblePositioner* bubble_positioner_; // Storage of string needed for accessibility. std::wstring accessible_name_; diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 9ce0ef5..b32a608 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -67,14 +67,6 @@ static const int kPopupTopSpacingNonGlass = 3; static const int kPopupBottomSpacingNonGlass = 2; static const int kPopupBottomSpacingGlass = 1; -// The vertical distance between the bottom of the omnibox and the top of the -// popup. -static const int kOmniboxPopupVerticalSpacing = 2; -// The number of pixels of margin on the buttons on either side of the omnibox. -// We use this value to inset the bounds returned for the omnibox popup, since -// we want the popup to be only as wide as the visible frame of the omnibox. -static const int kOmniboxButtonsHorizontalMargin = 2; - static SkBitmap* kPopupBackgroundEdge = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -364,27 +356,27 @@ void ToolbarView::ButtonPressed( } //////////////////////////////////////////////////////////////////////////////// -// ToolbarView, AutocompletePopupPositioner implementation: +// ToolbarView, BubblePositioner implementation: + +gfx::Rect ToolbarView::GetLocationStackBounds() const { + // The number of pixels from the left or right edges of the location stack to + // "just inside the visible borders". When the omnibox bubble contents are + // aligned with this, the visible borders tacked on to the outsides will line + // up with the visible borders on the location stack. + const int kLocationStackEdgeWidth = 2; -gfx::Rect ToolbarView::GetPopupBounds() const { gfx::Point origin; views::View::ConvertPointToScreen(star_, &origin); - origin.set_y(origin.y() + star_->height() + kOmniboxPopupVerticalSpacing); - gfx::Rect popup_bounds(origin.x(), origin.y(), + gfx::Rect stack_bounds(origin.x(), origin.y(), star_->width() + location_bar_->width() + go_->width(), - 0); + location_bar_->height()); if (UILayoutIsRightToLeft()) { - popup_bounds.set_x( - popup_bounds.x() - location_bar_->width() - go_->width()); - } else { - popup_bounds.set_x(popup_bounds.x()); + stack_bounds.set_x( + stack_bounds.x() - location_bar_->width() - go_->width()); } - popup_bounds.set_y(popup_bounds.y()); - popup_bounds.set_width(popup_bounds.width()); - // Inset the bounds a little, since the buttons on either edge of the omnibox - // have invisible padding that makes the popup appear too wide. - popup_bounds.Inset(kOmniboxButtonsHorizontalMargin, 0); - return popup_bounds; + // Inset the bounds to just inside the visible edges (see comment above). + stack_bounds.Inset(kLocationStackEdgeWidth, 0); + return stack_bounds; } //////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index 051b22d..ed42a11 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -9,9 +9,9 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "chrome/browser/bubble_positioner.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/user_data_manager.h" -#include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h" #include "chrome/browser/views/go_button.h" #include "chrome/browser/views/location_bar_view.h" #include "chrome/common/pref_member.h" @@ -72,7 +72,7 @@ class ToolbarView : public views::View, public GetProfilesHelper::Delegate, public CommandUpdater::CommandObserver, public views::ButtonListener, - public AutocompletePopupPositioner { + public BubblePositioner { public: explicit ToolbarView(Browser* browser); virtual ~ToolbarView(); @@ -128,8 +128,8 @@ class ToolbarView : public views::View, // Overridden from views::BaseButton::ButtonListener: virtual void ButtonPressed(views::Button* sender, const views::Event& event); - // Overridden from AutocompletePopupPositioner: - virtual gfx::Rect GetPopupBounds() const; + // BubblePositioner: + virtual gfx::Rect GetLocationStackBounds() const; // Overridden from NotificationObserver: virtual void Observe(NotificationType type, diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index e3ce12c..5553684 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -837,6 +837,7 @@ 'browser/browsing_data_remover.h', 'browser/browsing_instance.cc', 'browser/browsing_instance.h', + 'browser/bubble_positioner.h', 'browser/cancelable_request.cc', 'browser/cancelable_request.h', 'browser/cert_store.cc', |