| 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_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "base/prefs/pref_change_registrar.h" | 10 #include "base/prefs/pref_change_registrar.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // number of visible icons will be reset to what it was before highlighting. | 142 // number of visible icons will be reset to what it was before highlighting. |
| 143 void StopHighlighting(); | 143 void StopHighlighting(); |
| 144 | 144 |
| 145 // Sets the number of visible icons and notifies all observers of the change. | 145 // Sets the number of visible icons and notifies all observers of the change. |
| 146 void SetVisibleIconCountForTest(size_t visible_icons); | 146 void SetVisibleIconCountForTest(size_t visible_icons); |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 // content::NotificationObserver: | 149 // content::NotificationObserver: |
| 150 virtual void Observe(int type, | 150 virtual void Observe(int type, |
| 151 const content::NotificationSource& source, | 151 const content::NotificationSource& source, |
| 152 const content::NotificationDetails& details) OVERRIDE; | 152 const content::NotificationDetails& details) override; |
| 153 | 153 |
| 154 // Callback when extensions are ready. | 154 // Callback when extensions are ready. |
| 155 void OnReady(); | 155 void OnReady(); |
| 156 | 156 |
| 157 // ExtensionRegistryObserver: | 157 // ExtensionRegistryObserver: |
| 158 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 158 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 159 const Extension* extension) OVERRIDE; | 159 const Extension* extension) override; |
| 160 virtual void OnExtensionUnloaded( | 160 virtual void OnExtensionUnloaded( |
| 161 content::BrowserContext* browser_context, | 161 content::BrowserContext* browser_context, |
| 162 const Extension* extension, | 162 const Extension* extension, |
| 163 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 163 UnloadedExtensionInfo::Reason reason) override; |
| 164 virtual void OnExtensionUninstalled( | 164 virtual void OnExtensionUninstalled( |
| 165 content::BrowserContext* browser_context, | 165 content::BrowserContext* browser_context, |
| 166 const Extension* extension, | 166 const Extension* extension, |
| 167 extensions::UninstallReason reason) OVERRIDE; | 167 extensions::UninstallReason reason) override; |
| 168 | 168 |
| 169 // ExtensionActionAPI::Observer: | 169 // ExtensionActionAPI::Observer: |
| 170 virtual void OnExtensionActionUpdated( | 170 virtual void OnExtensionActionUpdated( |
| 171 ExtensionAction* extension_action, | 171 ExtensionAction* extension_action, |
| 172 content::WebContents* web_contents, | 172 content::WebContents* web_contents, |
| 173 content::BrowserContext* browser_context) OVERRIDE; | 173 content::BrowserContext* browser_context) override; |
| 174 | 174 |
| 175 // To be called after the extension service is ready; gets loaded extensions | 175 // To be called after the extension service is ready; gets loaded extensions |
| 176 // from the extension service and their saved order from the pref service | 176 // from the extension service and their saved order from the pref service |
| 177 // and constructs |toolbar_items_| from these data. | 177 // and constructs |toolbar_items_| from these data. |
| 178 void InitializeExtensionList(const ExtensionSet& extensions); | 178 void InitializeExtensionList(const ExtensionSet& extensions); |
| 179 void Populate(const ExtensionIdList& positions, | 179 void Populate(const ExtensionIdList& positions, |
| 180 const ExtensionSet& extensions); | 180 const ExtensionSet& extensions); |
| 181 | 181 |
| 182 // Save the model to prefs. | 182 // Save the model to prefs. |
| 183 void UpdatePrefs(); | 183 void UpdatePrefs(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 base::Closure pref_change_callback_; | 251 base::Closure pref_change_callback_; |
| 252 | 252 |
| 253 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; | 253 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; |
| 254 | 254 |
| 255 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 255 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 } // namespace extensions | 258 } // namespace extensions |
| 259 | 259 |
| 260 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 260 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |