summaryrefslogtreecommitdiffstats
path: root/chrome/browser/location_bar.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 20:15:35 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 20:15:35 +0000
commit7745b82920b6a761f316c78a85e7af8742434f1c (patch)
treed942f01dd45823d55c223dcfb868012d8194c82a /chrome/browser/location_bar.h
parent41910d1c4de903e0337ae41a9c835d918f8e264a (diff)
downloadchromium_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/location_bar.h')
-rw-r--r--chrome/browser/location_bar.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/location_bar.h b/chrome/browser/location_bar.h
new file mode 100644
index 0000000..0e6bc83
--- /dev/null
+++ b/chrome/browser/location_bar.h
@@ -0,0 +1,44 @@
+// 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_LOCATION_BAR_H_
+#define CHROME_BROWSER_LOCATION_BAR_H_
+
+////////////////////////////////////////////////////////////////////////////////
+// LocationBar
+// An interface providing access to the Location Bar component of the browser
+// window.
+//
+class LocationBar {
+ public:
+ // Shows the first run information bubble anchored to the location bar.
+ virtual void ShowFirstRunBubble() = 0;
+
+ // Returns the string of text entered in the location bar.
+ virtual std::wstring GetInputString() const = 0;
+
+ // Returns the WindowOpenDisposition that should be used to determine where to
+ // open a URL entered in the location bar.
+ virtual WindowOpenDisposition GetWindowOpenDisposition() const = 0;
+
+ // Returns the PageTransition that should be recorded in history when the URL
+ // entered in the location bar is loaded.
+ virtual PageTransition::Type GetPageTransition() const = 0;
+
+ // Accepts the current string of text entered in the location bar.
+ virtual void AcceptInput() = 0;
+
+ // Focuses and selects the contents of the location bar.
+ virtual void FocusLocation() = 0;
+
+ // Clears the location bar, inserts an annoying little "?" turd and sets focus
+ // to it.
+ virtual void FocusSearch() = 0;
+
+ // Saves the state of the location bar to the specified TabContents, so that
+ // it can be restored later. (Done when switching tabs).
+ virtual void SaveStateToContents(TabContents* contents) = 0;
+};
+
+#endif // #ifndef CHROME_BROWSER_LOCATION_BAR_H_