OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/notification_observer.h" | 11 #include "chrome/common/notification_observer.h" |
12 #include "chrome/common/notification_registrar.h" | 12 #include "chrome/common/notification_registrar.h" |
13 | 13 |
14 class ExtensionsService; | 14 class ExtensionsService; |
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(ExtensionsService* service); | 20 explicit ExtensionToolbarModel(ExtensionsService* service); |
21 ~ExtensionToolbarModel(); | 21 ~ExtensionToolbarModel(); |
22 | 22 |
| 23 // Notifies the toolbar model that the Profile that suplied its |
| 24 // prefs is being destroyed. |
| 25 void DestroyingProfile(); |
| 26 |
23 // A class which is informed of changes to the model; represents the view of | 27 // A class which is informed of changes to the model; represents the view of |
24 // MVC. | 28 // MVC. |
25 class Observer { | 29 class Observer { |
26 public: | 30 public: |
27 // An extension with a browser action button has been added, and should go | 31 // An extension with a browser action button has been added, and should go |
28 // in the toolbar at |index|. | 32 // in the toolbar at |index|. |
29 virtual void BrowserActionAdded(Extension* extension, int index) {} | 33 virtual void BrowserActionAdded(Extension* extension, int index) {} |
30 | 34 |
31 // The browser action button for |extension| should no longer show. | 35 // The browser action button for |extension| should no longer show. |
32 virtual void BrowserActionRemoved(Extension* extension) {} | 36 virtual void BrowserActionRemoved(Extension* extension) {} |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 size_t last_extension_removed_index_; | 114 size_t last_extension_removed_index_; |
111 | 115 |
112 // The number of icons visible (the rest should be hidden in the overflow | 116 // The number of icons visible (the rest should be hidden in the overflow |
113 // chevron). | 117 // chevron). |
114 int visible_icon_count_; | 118 int visible_icon_count_; |
115 | 119 |
116 NotificationRegistrar registrar_; | 120 NotificationRegistrar registrar_; |
117 }; | 121 }; |
118 | 122 |
119 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 123 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
OLD | NEW |