| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Callback when extensions are ready. | 144 // Callback when extensions are ready. |
| 145 void OnReady(); | 145 void OnReady(); |
| 146 | 146 |
| 147 // ExtensionRegistryObserver implementation. | 147 // ExtensionRegistryObserver implementation. |
| 148 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 148 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 149 const Extension* extension) OVERRIDE; | 149 const Extension* extension) OVERRIDE; |
| 150 virtual void OnExtensionUnloaded( | 150 virtual void OnExtensionUnloaded( |
| 151 content::BrowserContext* browser_context, | 151 content::BrowserContext* browser_context, |
| 152 const Extension* extension, | 152 const Extension* extension, |
| 153 UnloadedExtensionInfo::Reason reason) OVERRIDE; | 153 UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| 154 virtual void OnExtensionUninstalled(content::BrowserContext* browser_context, |
| 155 const Extension* extension) OVERRIDE; |
| 154 | 156 |
| 155 // To be called after the extension service is ready; gets loaded extensions | 157 // To be called after the extension service is ready; gets loaded extensions |
| 156 // from the extension service and their saved order from the pref service | 158 // from the extension service and their saved order from the pref service |
| 157 // and constructs |toolbar_items_| from these data. | 159 // and constructs |toolbar_items_| from these data. |
| 158 void InitializeExtensionList(const ExtensionSet& extensions); | 160 void InitializeExtensionList(const ExtensionSet& extensions); |
| 159 void Populate(const ExtensionIdList& positions, | 161 void Populate(const ExtensionIdList& positions, |
| 160 const ExtensionSet& extensions); | 162 const ExtensionSet& extensions); |
| 161 | 163 |
| 162 // Save the model to prefs. | 164 // Save the model to prefs. |
| 163 void UpdatePrefs(); | 165 void UpdatePrefs(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 base::Closure pref_change_callback_; | 216 base::Closure pref_change_callback_; |
| 215 | 217 |
| 216 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; | 218 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; |
| 217 | 219 |
| 218 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 220 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 219 }; | 221 }; |
| 220 | 222 |
| 221 } // namespace extensions | 223 } // namespace extensions |
| 222 | 224 |
| 223 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 225 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |