| 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 29 matching lines...) Expand all Loading... |
| 40 class ZoomDecoration; | 40 class ZoomDecoration; |
| 41 class ZoomDecorationTest; | 41 class ZoomDecorationTest; |
| 42 | 42 |
| 43 // 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 |
| 44 // the portable code. Wires up an OmniboxViewMac instance to | 44 // the portable code. Wires up an OmniboxViewMac instance to |
| 45 // the location bar text field, which handles most of the work. | 45 // the location bar text field, which handles most of the work. |
| 46 | 46 |
| 47 class LocationBarViewMac : public LocationBar, | 47 class LocationBarViewMac : public LocationBar, |
| 48 public LocationBarTesting, | 48 public LocationBarTesting, |
| 49 public OmniboxEditController, | 49 public OmniboxEditController, |
| 50 public content::NotificationObserver, | |
| 51 public SearchModelObserver { | 50 public SearchModelObserver { |
| 52 public: | 51 public: |
| 53 LocationBarViewMac(AutocompleteTextField* field, | 52 LocationBarViewMac(AutocompleteTextField* field, |
| 54 CommandUpdater* command_updater, | 53 CommandUpdater* command_updater, |
| 55 Profile* profile, | 54 Profile* profile, |
| 56 Browser* browser); | 55 Browser* browser); |
| 57 virtual ~LocationBarViewMac(); | 56 virtual ~LocationBarViewMac(); |
| 58 | 57 |
| 59 // Overridden from LocationBar: | 58 // Overridden from LocationBar: |
| 60 virtual void ShowFirstRunBubble() OVERRIDE; | 59 virtual void ShowFirstRunBubble() OVERRIDE; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 virtual void EndOriginChipAnimations(bool cancel_fade) OVERRIDE; | 158 virtual void EndOriginChipAnimations(bool cancel_fade) OVERRIDE; |
| 160 virtual InstantController* GetInstant() OVERRIDE; | 159 virtual InstantController* GetInstant() OVERRIDE; |
| 161 virtual content::WebContents* GetWebContents() OVERRIDE; | 160 virtual content::WebContents* GetWebContents() OVERRIDE; |
| 162 virtual ToolbarModel* GetToolbarModel() OVERRIDE; | 161 virtual ToolbarModel* GetToolbarModel() OVERRIDE; |
| 163 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; | 162 virtual const ToolbarModel* GetToolbarModel() const OVERRIDE; |
| 164 | 163 |
| 165 NSImage* GetKeywordImage(const base::string16& keyword); | 164 NSImage* GetKeywordImage(const base::string16& keyword); |
| 166 | 165 |
| 167 AutocompleteTextField* GetAutocompleteTextField() { return field_; } | 166 AutocompleteTextField* GetAutocompleteTextField() { return field_; } |
| 168 | 167 |
| 169 | |
| 170 // content::NotificationObserver: | |
| 171 virtual void Observe(int type, | |
| 172 const content::NotificationSource& source, | |
| 173 const content::NotificationDetails& details) OVERRIDE; | |
| 174 | |
| 175 // SearchModelObserver: | 168 // SearchModelObserver: |
| 176 virtual void ModelChanged(const SearchModel::State& old_state, | 169 virtual void ModelChanged(const SearchModel::State& old_state, |
| 177 const SearchModel::State& new_state) OVERRIDE; | 170 const SearchModel::State& new_state) OVERRIDE; |
| 178 | 171 |
| 179 Browser* browser() const { return browser_; } | 172 Browser* browser() const { return browser_; } |
| 180 | 173 |
| 181 // Activates the page action for the extension that has the given id. | 174 // Activates the page action for the extension that has the given id. |
| 182 void ActivatePageAction(const std::string& extension_id); | 175 void ActivatePageAction(const std::string& extension_id); |
| 183 | 176 |
| 184 protected: | 177 protected: |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 scoped_ptr<SearchButtonDecoration> search_button_decoration_; | 263 scoped_ptr<SearchButtonDecoration> search_button_decoration_; |
| 271 | 264 |
| 272 // The left-hand-side origin chip. | 265 // The left-hand-side origin chip. |
| 273 scoped_ptr<OriginChipDecoration> origin_chip_decoration_; | 266 scoped_ptr<OriginChipDecoration> origin_chip_decoration_; |
| 274 | 267 |
| 275 // The right-hand-side button to manage passwords associated with a page. | 268 // The right-hand-side button to manage passwords associated with a page. |
| 276 scoped_ptr<ManagePasswordsDecoration> manage_passwords_decoration_; | 269 scoped_ptr<ManagePasswordsDecoration> manage_passwords_decoration_; |
| 277 | 270 |
| 278 Browser* browser_; | 271 Browser* browser_; |
| 279 | 272 |
| 280 // Used to register for notifications received by NotificationObserver. | |
| 281 content::NotificationRegistrar registrar_; | |
| 282 | |
| 283 // Used to schedule a task for the first run info bubble. | 273 // Used to schedule a task for the first run info bubble. |
| 284 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; | 274 base::WeakPtrFactory<LocationBarViewMac> weak_ptr_factory_; |
| 285 | 275 |
| 286 // Used to change the visibility of the star decoration. | 276 // Used to change the visibility of the star decoration. |
| 287 BooleanPrefMember edit_bookmarks_enabled_; | 277 BooleanPrefMember edit_bookmarks_enabled_; |
| 288 | 278 |
| 289 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); | 279 DISALLOW_COPY_AND_ASSIGN(LocationBarViewMac); |
| 290 }; | 280 }; |
| 291 | 281 |
| 292 #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 |