From da99a54a499890a2773b4c4ed5e9fe54b35780d1 Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Tue, 27 Jan 2009 01:07:18 +0000 Subject: Extract a cross-platform LocationBar interface accessible via the BrowserWindow interface that the Browser object can use to do locationbar-ey things without directly depending on Views. Review URL: http://codereview.chromium.org/18826 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8693 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/location_bar_view.h | 33 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'chrome/browser/views/location_bar_view.h') diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index eb3b4ef..ec01c63 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -9,6 +9,7 @@ #include "base/gfx/rect.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" +#include "chrome/browser/location_bar.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/toolbar_model.h" #include "chrome/browser/views/info_bubble.h" @@ -30,10 +31,10 @@ class Profile; // of the URL bar strip and contains its content. // ///////////////////////////////////////////////////////////////////////////// -class LocationBarView : public views::View, +class LocationBarView : public LocationBar, + public views::View, public AutocompleteEditController { public: - class Delegate { public: // Should return the current tab contents. @@ -107,25 +108,19 @@ class LocationBarView : public views::View, return location_entry_.get(); } - std::wstring location_input() { - return location_input_; - } - - WindowOpenDisposition disposition() { - return disposition_; - } - - PageTransition::Type transition() { - return transition_; - } - - // Shows a info bubble that tells the user what the omnibox is and allows - // to change the search providers. - void ShowFirstRunBubble(); - - // Overridden from View. + // Overridden from views::View: virtual bool OverrideAccelerator(const views::Accelerator& accelerator); + // Overridden from LocationBar: + virtual void ShowFirstRunBubble(); + virtual std::wstring GetInputString() const; + virtual WindowOpenDisposition GetWindowOpenDisposition() const; + virtual PageTransition::Type GetPageTransition() const; + virtual void AcceptInput(); + virtual void FocusLocation(); + virtual void FocusSearch(); + virtual void SaveStateToContents(TabContents* contents); + static const int kTextVertMargin; static const COLORREF kBackgroundColorByLevel[]; -- cgit v1.1