Chromium Code Reviews| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 // value returned is a zero-based index into the vector of visible items. | 217 // value returned is a zero-based index into the vector of visible items. |
| 218 size_t FindNewPositionFromLastKnownGood(const Extension* extension); | 218 size_t FindNewPositionFromLastKnownGood(const Extension* extension); |
| 219 | 219 |
| 220 // Returns true if the given |extension| should be added to the toolbar. | 220 // Returns true if the given |extension| should be added to the toolbar. |
| 221 bool ShouldAddExtension(const Extension* extension); | 221 bool ShouldAddExtension(const Extension* extension); |
| 222 | 222 |
| 223 // Adds or removes the given |extension| from the toolbar model. | 223 // Adds or removes the given |extension| from the toolbar model. |
| 224 void AddExtension(const Extension* extension); | 224 void AddExtension(const Extension* extension); |
| 225 void RemoveExtension(const Extension* extension); | 225 void RemoveExtension(const Extension* extension); |
| 226 | 226 |
| 227 // Removes all current items (because we're going to [re]Populate()). | |
| 228 void ClearItems(); | |
|
Marijn Kruisselbrink
2014/11/17 22:18:02
Just curious what changed that before you had this
Devlin
2014/11/17 22:44:13
At one point, it was called multiple times; now th
| |
| 229 | |
| 230 // Our observers. | 227 // Our observers. |
| 231 ObserverList<Observer> observers_; | 228 ObserverList<Observer> observers_; |
| 232 | 229 |
| 233 // The Profile this toolbar model is for. | 230 // The Profile this toolbar model is for. |
| 234 Profile* profile_; | 231 Profile* profile_; |
| 235 | 232 |
| 236 ExtensionPrefs* extension_prefs_; | 233 ExtensionPrefs* extension_prefs_; |
| 237 PrefService* prefs_; | 234 PrefService* prefs_; |
| 238 | 235 |
| 239 // True if we've handled the initial EXTENSIONS_READY notification. | 236 // True if we've handled the initial EXTENSIONS_READY notification. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 282 base::Closure pref_change_callback_; | 279 base::Closure pref_change_callback_; |
| 283 | 280 |
| 284 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; | 281 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; |
| 285 | 282 |
| 286 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 283 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 287 }; | 284 }; |
| 288 | 285 |
| 289 } // namespace extensions | 286 } // namespace extensions |
| 290 | 287 |
| 291 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 288 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |