diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 20:15:35 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 20:15:35 +0000 |
commit | 7745b82920b6a761f316c78a85e7af8742434f1c (patch) | |
tree | d942f01dd45823d55c223dcfb868012d8194c82a /chrome/browser/views/location_bar_view.h | |
parent | 41910d1c4de903e0337ae41a9c835d918f8e264a (diff) | |
download | chromium_src-7745b82920b6a761f316c78a85e7af8742434f1c.zip chromium_src-7745b82920b6a761f316c78a85e7af8742434f1c.tar.gz chromium_src-7745b82920b6a761f316c78a85e7af8742434f1c.tar.bz2 |
Re-land this from earlier... unit tests no longer crash.
Extract a cross platform LocationBar interface.
Adds a TestLocationBar object that unit tests can use to mock the location bar (fixes NULL deref).
Review URL: http://codereview.chromium.org/18851
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/location_bar_view.h')
-rw-r--r-- | chrome/browser/views/location_bar_view.h | 33 |
1 files changed, 14 insertions, 19 deletions
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[]; |