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 20 matching lines...) Expand all Loading... |
31 class LocationBarViewMacBrowserTest; | 31 class LocationBarViewMacBrowserTest; |
32 class LocationIconDecoration; | 32 class LocationIconDecoration; |
33 class PageActionDecoration; | 33 class PageActionDecoration; |
34 class PlusDecoration; | 34 class PlusDecoration; |
35 class Profile; | 35 class Profile; |
36 class SearchTokenDecoration; | 36 class SearchTokenDecoration; |
37 class SelectedKeywordDecoration; | 37 class SelectedKeywordDecoration; |
38 class SeparatorDecoration; | 38 class SeparatorDecoration; |
39 class StarDecoration; | 39 class StarDecoration; |
40 class ToolbarModel; | 40 class ToolbarModel; |
41 class WebIntentsButtonDecoration; | |
42 class ZoomDecoration; | 41 class ZoomDecoration; |
43 | 42 |
44 // A C++ bridge class that represents the location bar UI element to | 43 // A C++ bridge class that represents the location bar UI element to |
45 // the portable code. Wires up an OmniboxViewMac instance to | 44 // the portable code. Wires up an OmniboxViewMac instance to |
46 // the location bar text field, which handles most of the work. | 45 // the location bar text field, which handles most of the work. |
47 | 46 |
48 class LocationBarViewMac : public LocationBar, | 47 class LocationBarViewMac : public LocationBar, |
49 public LocationBarTesting, | 48 public LocationBarTesting, |
50 public OmniboxEditController, | 49 public OmniboxEditController, |
51 public content::NotificationObserver { | 50 public content::NotificationObserver { |
(...skipping 11 matching lines...) Expand all Loading... |
63 const InstantSuggestion& suggestion) OVERRIDE; | 62 const InstantSuggestion& suggestion) OVERRIDE; |
64 virtual string16 GetInputString() const OVERRIDE; | 63 virtual string16 GetInputString() const OVERRIDE; |
65 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 64 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; |
66 virtual content::PageTransition GetPageTransition() const OVERRIDE; | 65 virtual content::PageTransition GetPageTransition() const OVERRIDE; |
67 virtual void AcceptInput() OVERRIDE; | 66 virtual void AcceptInput() OVERRIDE; |
68 virtual void FocusLocation(bool select_all) OVERRIDE; | 67 virtual void FocusLocation(bool select_all) OVERRIDE; |
69 virtual void FocusSearch() OVERRIDE; | 68 virtual void FocusSearch() OVERRIDE; |
70 virtual void UpdateContentSettingsIcons() OVERRIDE; | 69 virtual void UpdateContentSettingsIcons() OVERRIDE; |
71 virtual void UpdatePageActions() OVERRIDE; | 70 virtual void UpdatePageActions() OVERRIDE; |
72 virtual void InvalidatePageActions() OVERRIDE; | 71 virtual void InvalidatePageActions() OVERRIDE; |
73 #if defined(ENABLE_WEB_INTENTS) | |
74 virtual void UpdateWebIntentsButton() OVERRIDE; | |
75 #endif | |
76 virtual void UpdateOpenPDFInReaderPrompt() OVERRIDE; | 72 virtual void UpdateOpenPDFInReaderPrompt() OVERRIDE; |
77 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; | 73 virtual void SaveStateToContents(content::WebContents* contents) OVERRIDE; |
78 virtual void Revert() OVERRIDE; | 74 virtual void Revert() OVERRIDE; |
79 virtual const OmniboxView* GetLocationEntry() const OVERRIDE; | 75 virtual const OmniboxView* GetLocationEntry() const OVERRIDE; |
80 virtual OmniboxView* GetLocationEntry() OVERRIDE; | 76 virtual OmniboxView* GetLocationEntry() OVERRIDE; |
81 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; | 77 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; |
82 | 78 |
83 // Overridden from LocationBarTesting: | 79 // Overridden from LocationBarTesting: |
84 virtual int PageActionCount() OVERRIDE; | 80 virtual int PageActionCount() OVERRIDE; |
85 virtual int PageActionVisibleCount() OVERRIDE; | 81 virtual int PageActionVisibleCount() OVERRIDE; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void OnEditBookmarksEnabledChanged(); | 196 void OnEditBookmarksEnabledChanged(); |
201 | 197 |
202 // Re-generate the page-action decorations from the profile's | 198 // Re-generate the page-action decorations from the profile's |
203 // extension service. | 199 // extension service. |
204 void RefreshPageActionDecorations(); | 200 void RefreshPageActionDecorations(); |
205 | 201 |
206 // Updates visibility of the content settings icons based on the current | 202 // Updates visibility of the content settings icons based on the current |
207 // tab contents state. | 203 // tab contents state. |
208 bool RefreshContentSettingsDecorations(); | 204 bool RefreshContentSettingsDecorations(); |
209 | 205 |
210 // Updates visibility of the web intents button decoration based on the | |
211 // current tab contents state. | |
212 void RefreshWebIntentsButtonDecoration(); | |
213 | |
214 void ShowFirstRunBubbleInternal(); | 206 void ShowFirstRunBubbleInternal(); |
215 | 207 |
216 // Checks if the bookmark star should be enabled or not. | 208 // Checks if the bookmark star should be enabled or not. |
217 bool IsStarEnabled(); | 209 bool IsStarEnabled(); |
218 | 210 |
219 // Updates the zoom decoration in the omnibox with the current zoom level. | 211 // Updates the zoom decoration in the omnibox with the current zoom level. |
220 void UpdateZoomDecoration(); | 212 void UpdateZoomDecoration(); |
221 | 213 |
222 // Ensures the star decoration is visible or hidden, as required. | 214 // Ensures the star decoration is visible or hidden, as required. |
223 void UpdateStarDecorationVisibility(); | 215 void UpdateStarDecorationVisibility(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 265 |
274 // Decorations for the installed Page Actions. | 266 // Decorations for the installed Page Actions. |
275 ScopedVector<PageActionDecoration> page_action_decorations_; | 267 ScopedVector<PageActionDecoration> page_action_decorations_; |
276 | 268 |
277 // The content blocked decorations. | 269 // The content blocked decorations. |
278 ScopedVector<ContentSettingDecoration> content_setting_decorations_; | 270 ScopedVector<ContentSettingDecoration> content_setting_decorations_; |
279 | 271 |
280 // Keyword hint decoration displayed on the right-hand side. | 272 // Keyword hint decoration displayed on the right-hand side. |
281 scoped_ptr<KeywordHintDecoration> keyword_hint_decoration_; | 273 scoped_ptr<KeywordHintDecoration> keyword_hint_decoration_; |
282 | 274 |
283 #if defined(ENABLE_WEB_INTENTS) | |
284 // A decoration that shows the web intents "use another service" button | |
285 // on the right. | |
286 scoped_ptr<WebIntentsButtonDecoration> web_intents_button_decoration_; | |
287 #endif | |
288 | |
289 Profile* profile_; | 275 Profile* profile_; |
290 | 276 |
291 Browser* browser_; | 277 Browser* browser_; |
292 | 278 |
293 ToolbarModel* toolbar_model_; // Weak, owned by Browser. | 279 ToolbarModel* toolbar_model_; // Weak, owned by Browser. |
294 | 280 |
295 // The transition type to use for the navigation. | 281 // The transition type to use for the navigation. |
296 content::PageTransition transition_; | 282 content::PageTransition transition_; |
297 | 283 |
298 // Used to register for notifications received by NotificationObserver. | 284 // Used to register for notifications received by NotificationObserver. |
299 content::NotificationRegistrar registrar_; | 285 content::NotificationRegistrar registrar_; |
300 | 286 |
301 // Used to schedule a task for the first run info bubble. | 287 // Used to schedule a task for the first run info bubble. |
302 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 288 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
303 | 289 |
304 // Used to change the visibility of the star decoration. | 290 // Used to change the visibility of the star decoration. |
305 BooleanPrefMember edit_bookmarks_enabled_; | 291 BooleanPrefMember edit_bookmarks_enabled_; |
306 | 292 |
307 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 293 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
308 }; | 294 }; |
309 | 295 |
310 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ | 296 #endif // CHROME_BROWSER_UI_COCOA_LOCATION_BAR_LOCATION_BAR_VIEW_MAC_H_ |
OLD | NEW |