| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ExtensionAction* extension_action, | 180 ExtensionAction* extension_action, |
| 181 content::WebContents* web_contents, | 181 content::WebContents* web_contents, |
| 182 content::BrowserContext* browser_context) override; | 182 content::BrowserContext* browser_context) override; |
| 183 | 183 |
| 184 // To be called after the extension service is ready; gets loaded extensions | 184 // To be called after the extension service is ready; gets loaded extensions |
| 185 // from the ExtensionRegistry and their saved order from the pref service | 185 // from the ExtensionRegistry and their saved order from the pref service |
| 186 // and constructs |toolbar_items_| from these data. IncognitoPopulate() | 186 // and constructs |toolbar_items_| from these data. IncognitoPopulate() |
| 187 // takes the shortcut - looking at the regular model's content and modifying | 187 // takes the shortcut - looking at the regular model's content and modifying |
| 188 // it. | 188 // it. |
| 189 void InitializeExtensionList(); | 189 void InitializeExtensionList(); |
| 190 void Populate(const ExtensionIdList& positions); | 190 void Populate(ExtensionIdList* positions); |
| 191 void IncognitoPopulate(); | 191 void IncognitoPopulate(); |
| 192 | 192 |
| 193 // Save the model to prefs. | 193 // Save the model to prefs. |
| 194 void UpdatePrefs(); | 194 void UpdatePrefs(); |
| 195 | 195 |
| 196 // Updates |extension|'s browser action visibility pref if the browser action | 196 // Updates |extension|'s browser action visibility pref if the browser action |
| 197 // is in the overflow menu and should be considered hidden. | 197 // is in the overflow menu and should be considered hidden. |
| 198 void MaybeUpdateVisibilityPref(const Extension* extension, size_t index); | 198 void MaybeUpdateVisibilityPref(const Extension* extension, size_t index); |
| 199 | 199 |
| 200 // Calls MaybeUpdateVisibilityPref() for each extension in |toolbar_items|. | 200 // Calls MaybeUpdateVisibilityPref() for each extension in |toolbar_items|. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 base::Closure pref_change_callback_; | 266 base::Closure pref_change_callback_; |
| 267 | 267 |
| 268 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; | 268 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; |
| 269 | 269 |
| 270 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 270 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 } // namespace extensions | 273 } // namespace extensions |
| 274 | 274 |
| 275 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 275 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |