OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // The LocationBar class is a virtual interface, defining access to the | 5 // The LocationBar class is a virtual interface, defining access to the |
6 // window's location bar component. This class exists so that cross-platform | 6 // window's location bar component. This class exists so that cross-platform |
7 // components like the browser command system can talk to the platform | 7 // components like the browser command system can talk to the platform |
8 // specific implementations of the location bar control. It also allows the | 8 // specific implementations of the location bar control. It also allows the |
9 // location bar to be mocked for testing. | 9 // location bar to be mocked for testing. |
10 | 10 |
11 #ifndef CHROME_BROWSER_LOCATION_BAR_H_ | 11 #ifndef CHROME_BROWSER_LOCATION_BAR_H_ |
12 #define CHROME_BROWSER_LOCATION_BAR_H_ | 12 #define CHROME_BROWSER_LOCATION_BAR_H_ |
13 #pragma once | 13 #pragma once |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
| 17 #include "base/string16.h" |
17 #include "chrome/browser/first_run/first_run.h" | 18 #include "chrome/browser/first_run/first_run.h" |
18 #include "chrome/common/page_transition_types.h" | 19 #include "chrome/common/page_transition_types.h" |
19 #include "webkit/glue/window_open_disposition.h" | 20 #include "webkit/glue/window_open_disposition.h" |
20 | 21 |
21 class AutocompleteEditView; | 22 class AutocompleteEditView; |
22 class ExtensionAction; | 23 class ExtensionAction; |
23 class LocationBarTesting; | 24 class LocationBarTesting; |
24 class TabContents; | 25 class TabContents; |
25 | 26 |
26 class LocationBar { | 27 class LocationBar { |
27 public: | 28 public: |
28 // Shows the first run information bubble anchored to the location bar. | 29 // Shows the first run information bubble anchored to the location bar. |
29 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) = 0; | 30 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) = 0; |
30 | 31 |
31 // TODO: port | |
32 #if defined(TOOLKIT_VIEWS) | |
33 // Sets the suggested text to show in the omnibox. This is shown in addition | 32 // Sets the suggested text to show in the omnibox. This is shown in addition |
34 // to the current text of the omnibox. | 33 // to the current text of the omnibox. |
35 virtual void SetSuggestedText(const std::wstring& text) = 0; | 34 virtual void SetSuggestedText(const string16& text) = 0; |
36 #endif | |
37 | 35 |
38 // Returns the string of text entered in the location bar. | 36 // Returns the string of text entered in the location bar. |
39 virtual std::wstring GetInputString() const = 0; | 37 virtual std::wstring GetInputString() const = 0; |
40 | 38 |
41 // Returns the WindowOpenDisposition that should be used to determine where | 39 // Returns the WindowOpenDisposition that should be used to determine where |
42 // to open a URL entered in the location bar. | 40 // to open a URL entered in the location bar. |
43 virtual WindowOpenDisposition GetWindowOpenDisposition() const = 0; | 41 virtual WindowOpenDisposition GetWindowOpenDisposition() const = 0; |
44 | 42 |
45 // Returns the PageTransition that should be recorded in history when the URL | 43 // Returns the PageTransition that should be recorded in history when the URL |
46 // entered in the location bar is loaded. | 44 // entered in the location bar is loaded. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; | 97 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; |
100 | 98 |
101 // Simulates a left mouse pressed on the visible page action at |index|. | 99 // Simulates a left mouse pressed on the visible page action at |index|. |
102 virtual void TestPageActionPressed(size_t index) = 0; | 100 virtual void TestPageActionPressed(size_t index) = 0; |
103 | 101 |
104 protected: | 102 protected: |
105 virtual ~LocationBarTesting() {} | 103 virtual ~LocationBarTesting() {} |
106 }; | 104 }; |
107 | 105 |
108 #endif // CHROME_BROWSER_LOCATION_BAR_H_ | 106 #endif // CHROME_BROWSER_LOCATION_BAR_H_ |
OLD | NEW |