Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model.h

Issue 731353002: [Extensions Toolbar] Notify observers of extensions re-added after a pref change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marijn's Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698