OLD | NEW |
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Return |page_action|'s info-bubble point in window coordinates. | 143 // Return |page_action|'s info-bubble point in window coordinates. |
144 // This function should always be called with a visible page action. | 144 // This function should always be called with a visible page action. |
145 // If |page_action| is not a page action or not visible, NOTREACHED() | 145 // If |page_action| is not a page action or not visible, NOTREACHED() |
146 // is called and this function returns |NSZeroPoint|. | 146 // is called and this function returns |NSZeroPoint|. |
147 NSPoint GetPageActionBubblePoint(ExtensionAction* page_action); | 147 NSPoint GetPageActionBubblePoint(ExtensionAction* page_action); |
148 | 148 |
149 // OmniboxEditController: | 149 // OmniboxEditController: |
150 virtual void Update(const content::WebContents* contents) OVERRIDE; | 150 virtual void Update(const content::WebContents* contents) OVERRIDE; |
151 virtual void OnChanged() OVERRIDE; | 151 virtual void OnChanged() OVERRIDE; |
152 virtual void OnSetFocus() OVERRIDE; | 152 virtual void OnSetFocus() OVERRIDE; |
| 153 virtual void ShowURL() OVERRIDE; |
153 virtual InstantController* GetInstant() OVERRIDE; | 154 virtual InstantController* GetInstant() OVERRIDE; |
154 virtual content::WebContents* GetWebContents() OVERRIDE; | 155 virtual content::WebContents* GetWebContents() OVERRIDE; |
155 virtual ToolbarModel* GetToolbarModel() OVERRIDE; | 156 virtual ToolbarModel* GetToolbarModel() OVERRIDE; |
156 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; | 157 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; |
157 | 158 |
158 NSImage* GetKeywordImage(const base::string16& keyword); | 159 NSImage* GetKeywordImage(const base::string16& keyword); |
159 | 160 |
160 AutocompleteTextField* GetAutocompleteTextField() { return field_; } | 161 AutocompleteTextField* GetAutocompleteTextField() { return field_; } |
161 | 162 |
162 | 163 |
163 // content::NotificationObserver: | 164 // content::NotificationObserver: |
164 virtual void Observe(int type, | 165 virtual void Observe(int type, |
165 const content::NotificationSource& source, | 166 const content::NotificationSource& source, |
166 const content::NotificationDetails& details) OVERRIDE; | 167 const content::NotificationDetails& details) OVERRIDE; |
167 | 168 |
168 // SearchModelObserver: | 169 // SearchModelObserver: |
169 virtual void ModelChanged(const SearchModel::State& old_state, | 170 virtual void ModelChanged(const SearchModel::State& old_state, |
170 const SearchModel::State& new_state) OVERRIDE; | 171 const SearchModel::State& new_state) OVERRIDE; |
171 | 172 |
172 Browser* browser() const { return browser_; } | 173 Browser* browser() const { return browser_; } |
173 | 174 |
174 // Activates the page action for the extension that has the given id. | 175 // Activates the page action for the extension that has the given id. |
175 void ActivatePageAction(const std::string& extension_id); | 176 void ActivatePageAction(const std::string& extension_id); |
176 | 177 |
| 178 protected: |
| 179 // OmniboxEditController: |
| 180 virtual void HideURL() OVERRIDE; |
| 181 |
177 private: | 182 private: |
178 friend ZoomDecorationTest; | 183 friend ZoomDecorationTest; |
179 | 184 |
180 // Posts |notification| to the default notification center. | 185 // Posts |notification| to the default notification center. |
181 void PostNotification(NSString* notification); | 186 void PostNotification(NSString* notification); |
182 | 187 |
183 // Return the decoration for |page_action|. | 188 // Return the decoration for |page_action|. |
184 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action); | 189 PageActionDecoration* GetPageActionDecoration(ExtensionAction* page_action); |
185 | 190 |
186 // Clear the page-action decorations. | 191 // Clear the page-action decorations. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // Used to schedule a task for the first run info bubble. | 273 // Used to schedule a task for the first run info bubble. |
269 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 274 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
270 | 275 |
271 // Used to change the visibility of the star decoration. | 276 // Used to change the visibility of the star decoration. |
272 BooleanPrefMember edit_bookmarks_enabled_; | 277 BooleanPrefMember edit_bookmarks_enabled_; |
273 | 278 |
274 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 279 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
275 }; | 280 }; |
276 | 281 |
277 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 282 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
OLD | NEW |