| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // the ToolbarModel to only display those extensions. | 137 // the ToolbarModel to only display those extensions. |
| 138 // Highlighting mode is only entered if there is at least one extension to | 138 // Highlighting mode is only entered if there is at least one extension to |
| 139 // be shown. | 139 // be shown. |
| 140 // Returns true if highlighting mode is entered, false otherwise. | 140 // Returns true if highlighting mode is entered, false otherwise. |
| 141 bool HighlightExtensions(const ExtensionIdList& extension_ids); | 141 bool HighlightExtensions(const ExtensionIdList& extension_ids); |
| 142 | 142 |
| 143 // Stop highlighting extensions. All extensions can be shown again, and the | 143 // Stop highlighting extensions. All extensions can be shown again, and the |
| 144 // number of visible icons will be reset to what it was before highlighting. | 144 // number of visible icons will be reset to what it was before highlighting. |
| 145 void StopHighlighting(); | 145 void StopHighlighting(); |
| 146 | 146 |
| 147 // Sets the number of visible icons and notifies all observers of the change. |
| 148 void SetVisibleIconCountForTest(size_t visible_icons); |
| 149 |
| 147 private: | 150 private: |
| 148 // content::NotificationObserver: | 151 // content::NotificationObserver: |
| 149 virtual void Observe(int type, | 152 virtual void Observe(int type, |
| 150 const content::NotificationSource& source, | 153 const content::NotificationSource& source, |
| 151 const content::NotificationDetails& details) OVERRIDE; | 154 const content::NotificationDetails& details) OVERRIDE; |
| 152 | 155 |
| 153 // Callback when extensions are ready. | 156 // Callback when extensions are ready. |
| 154 void OnReady(); | 157 void OnReady(); |
| 155 | 158 |
| 156 // ExtensionRegistryObserver: | 159 // ExtensionRegistryObserver: |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 base::Closure pref_change_callback_; | 253 base::Closure pref_change_callback_; |
| 251 | 254 |
| 252 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; | 255 base::WeakPtrFactory<ExtensionToolbarModel> weak_ptr_factory_; |
| 253 | 256 |
| 254 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 257 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 255 }; | 258 }; |
| 256 | 259 |
| 257 } // namespace extensions | 260 } // namespace extensions |
| 258 | 261 |
| 259 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 262 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |