| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "content/common/notification_observer.h" | 11 #include "content/common/notification_observer.h" |
| 12 #include "content/common/notification_registrar.h" | 12 #include "content/common/notification_registrar.h" |
| 13 | 13 |
| 14 class ExtensionService; | 14 class ExtensionService; |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 // Model for the browser actions toolbar. | 17 // Model for the browser actions toolbar. |
| 18 class ExtensionToolbarModel : public NotificationObserver { | 18 class ExtensionToolbarModel : public NotificationObserver { |
| 19 public: | 19 public: |
| 20 explicit ExtensionToolbarModel(ExtensionService* service); | 20 explicit ExtensionToolbarModel(ExtensionService* service); |
| 21 ~ExtensionToolbarModel(); | 21 virtual ~ExtensionToolbarModel(); |
| 22 | 22 |
| 23 // A class which is informed of changes to the model; represents the view of | 23 // A class which is informed of changes to the model; represents the view of |
| 24 // MVC. | 24 // MVC. |
| 25 class Observer { | 25 class Observer { |
| 26 public: | 26 public: |
| 27 // An extension with a browser action button has been added, and should go | 27 // An extension with a browser action button has been added, and should go |
| 28 // in the toolbar at |index|. | 28 // in the toolbar at |index|. |
| 29 virtual void BrowserActionAdded(const Extension* extension, int index) {} | 29 virtual void BrowserActionAdded(const Extension* extension, int index) {} |
| 30 | 30 |
| 31 // The browser action button for |extension| should no longer show. | 31 // The browser action button for |extension| should no longer show. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 size_t last_extension_removed_index_; | 110 size_t last_extension_removed_index_; |
| 111 | 111 |
| 112 // The number of icons visible (the rest should be hidden in the overflow | 112 // The number of icons visible (the rest should be hidden in the overflow |
| 113 // chevron). | 113 // chevron). |
| 114 int visible_icon_count_; | 114 int visible_icon_count_; |
| 115 | 115 |
| 116 NotificationRegistrar registrar_; | 116 NotificationRegistrar registrar_; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 119 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |