OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_OMNIBOX_LOCATION_BAR_H_ | 11 #ifndef CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ |
12 #define CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ | 12 #define CHROME_BROWSER_UI_OMNIBOX_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 "base/string16.h" |
18 #include "chrome/browser/first_run/first_run.h" | |
19 #include "chrome/browser/instant/instant_delegate.h" | 18 #include "chrome/browser/instant/instant_delegate.h" |
20 #include "content/public/common/page_transition_types.h" | 19 #include "content/public/common/page_transition_types.h" |
21 #include "webkit/glue/window_open_disposition.h" | 20 #include "webkit/glue/window_open_disposition.h" |
22 | 21 |
23 class ExtensionAction; | 22 class ExtensionAction; |
24 class LocationBarTesting; | 23 class LocationBarTesting; |
25 class OmniboxView; | 24 class OmniboxView; |
26 | 25 |
27 namespace content { | 26 namespace content { |
28 class WebContents; | 27 class WebContents; |
29 } | 28 } |
30 | 29 |
31 class LocationBar { | 30 class LocationBar { |
32 public: | 31 public: |
33 // Shows the first run information bubble anchored to the location bar. | 32 // Shows the first run bubble anchored to the location bar. |
34 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) = 0; | 33 virtual void ShowFirstRunBubble() = 0; |
35 | 34 |
36 // Sets the suggested text to show in the omnibox. This is shown in addition | 35 // Sets the suggested text to show in the omnibox. This is shown in addition |
37 // to the current text of the omnibox. | 36 // to the current text of the omnibox. |
38 virtual void SetSuggestedText(const string16& text, | 37 virtual void SetSuggestedText(const string16& text, |
39 InstantCompleteBehavior behavior) = 0; | 38 InstantCompleteBehavior behavior) = 0; |
40 | 39 |
41 // Returns the string of text entered in the location bar. | 40 // Returns the string of text entered in the location bar. |
42 virtual string16 GetInputString() const = 0; | 41 virtual string16 GetInputString() const = 0; |
43 | 42 |
44 // Returns the WindowOpenDisposition that should be used to determine where | 43 // Returns the WindowOpenDisposition that should be used to determine where |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; | 101 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; |
103 | 102 |
104 // Simulates a left mouse pressed on the visible page action at |index|. | 103 // Simulates a left mouse pressed on the visible page action at |index|. |
105 virtual void TestPageActionPressed(size_t index) = 0; | 104 virtual void TestPageActionPressed(size_t index) = 0; |
106 | 105 |
107 protected: | 106 protected: |
108 virtual ~LocationBarTesting() {} | 107 virtual ~LocationBarTesting() {} |
109 }; | 108 }; |
110 | 109 |
111 #endif // CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ | 110 #endif // CHROME_BROWSER_UI_OMNIBOX_LOCATION_BAR_H_ |
OLD | NEW |