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 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // it can be restored later. (Done when switching tabs). | 62 // it can be restored later. (Done when switching tabs). |
63 virtual void SaveStateToContents(TabContents* contents) = 0; | 63 virtual void SaveStateToContents(TabContents* contents) = 0; |
64 | 64 |
65 // Reverts the location bar. The bar's permanent text will be shown. | 65 // Reverts the location bar. The bar's permanent text will be shown. |
66 virtual void Revert() = 0; | 66 virtual void Revert() = 0; |
67 | 67 |
68 // Returns a pointer to the text entry view. | 68 // Returns a pointer to the text entry view. |
69 virtual const AutocompleteEditView* location_entry() const = 0; | 69 virtual const AutocompleteEditView* location_entry() const = 0; |
70 virtual AutocompleteEditView* location_entry() = 0; | 70 virtual AutocompleteEditView* location_entry() = 0; |
71 | 71 |
72 // Hides the edit field of the location bar if it hasn't already been | |
73 // force-hidden. The force hidden count is tracked, so calling multiple | |
74 // times is allowed, you just have to be sure to call PopForceHidden | |
75 // the same number of times. Currently, this is only needed for Windows. | |
76 virtual void PushForceHidden() = 0; | |
77 virtual void PopForceHidden() = 0; | |
78 | |
79 // Returns a pointer to the testing interface. | 72 // Returns a pointer to the testing interface. |
80 virtual LocationBarTesting* GetLocationBarForTesting() = 0; | 73 virtual LocationBarTesting* GetLocationBarForTesting() = 0; |
81 | 74 |
82 protected: | 75 protected: |
83 virtual ~LocationBar() {} | 76 virtual ~LocationBar() {} |
84 }; | 77 }; |
85 | 78 |
86 class LocationBarTesting { | 79 class LocationBarTesting { |
87 public: | 80 public: |
88 // Returns the total number of page actions in the Omnibox. | 81 // Returns the total number of page actions in the Omnibox. |
89 virtual int PageActionCount() = 0; | 82 virtual int PageActionCount() = 0; |
90 | 83 |
91 // Returns the number of visible page actions in the Omnibox. | 84 // Returns the number of visible page actions in the Omnibox. |
92 virtual int PageActionVisibleCount() = 0; | 85 virtual int PageActionVisibleCount() = 0; |
93 | 86 |
94 // Returns the ExtensionAction at |index|. | 87 // Returns the ExtensionAction at |index|. |
95 virtual ExtensionAction* GetPageAction(size_t index) = 0; | 88 virtual ExtensionAction* GetPageAction(size_t index) = 0; |
96 | 89 |
97 // Returns the visible ExtensionAction at |index|. | 90 // Returns the visible ExtensionAction at |index|. |
98 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; | 91 virtual ExtensionAction* GetVisiblePageAction(size_t index) = 0; |
99 | 92 |
100 // Simulates a left mouse pressed on the visible page action at |index|. | 93 // Simulates a left mouse pressed on the visible page action at |index|. |
101 virtual void TestPageActionPressed(size_t index) = 0; | 94 virtual void TestPageActionPressed(size_t index) = 0; |
102 | 95 |
103 protected: | 96 protected: |
104 virtual ~LocationBarTesting() {} | 97 virtual ~LocationBarTesting() {} |
105 }; | 98 }; |
106 | 99 |
107 #endif // CHROME_BROWSER_LOCATION_BAR_H_ | 100 #endif // CHROME_BROWSER_LOCATION_BAR_H_ |
OLD | NEW |