| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "chrome/common/extensions/extension.h" | 11 #include "chrome/common/extensions/extension.h" |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 | 14 |
| 15 class Browser; | 15 class Browser; |
| 16 class ExtensionService; | 16 class ExtensionService; |
| 17 class PrefService; | 17 class PrefService; |
| 18 | 18 |
| 19 // Model for the browser actions toolbar. | 19 // Model for the browser actions toolbar. |
| 20 class ExtensionToolbarModel : public content::NotificationObserver { | 20 class ExtensionToolbarModel : public content::NotificationObserver { |
| 21 public: | 21 public: |
| 22 explicit ExtensionToolbarModel(ExtensionService* service); | 22 explicit ExtensionToolbarModel(ExtensionService* service); |
| 23 virtual ~ExtensionToolbarModel(); | 23 virtual ~ExtensionToolbarModel(); |
| 24 | 24 |
| 25 // The action that should be taken as a result of clicking a browser action. | 25 // The action that should be taken as a result of clicking a browser action. |
| 26 enum Action { | 26 enum Action { |
| 27 ACTION_NONE, | 27 ACTION_NONE, |
| 28 ACTION_SHOW_POPUP, | 28 ACTION_SHOW_POPUP, |
| 29 // Unlike ActionBoxController there is no ACTION_SHOW_CONTEXT_MENU, because | 29 // Unlike LocationBarController there is no ACTION_SHOW_CONTEXT_MENU, |
| 30 // UI implementations tend to handle this themselves at a higher level. | 30 // because UI implementations tend to handle this themselves at a higher |
| 31 // level. |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 // A class which is informed of changes to the model; represents the view of | 34 // A class which is informed of changes to the model; represents the view of |
| 34 // MVC. | 35 // MVC. |
| 35 class Observer { | 36 class Observer { |
| 36 public: | 37 public: |
| 37 // An extension with a browser action button has been added, and should go | 38 // An extension with a browser action button has been added, and should go |
| 38 // in the toolbar at |index|. | 39 // in the toolbar at |index|. |
| 39 virtual void BrowserActionAdded(const extensions::Extension* extension, | 40 virtual void BrowserActionAdded(const extensions::Extension* extension, |
| 40 int index) {} | 41 int index) {} |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // The number of icons visible (the rest should be hidden in the overflow | 132 // The number of icons visible (the rest should be hidden in the overflow |
| 132 // chevron). | 133 // chevron). |
| 133 int visible_icon_count_; | 134 int visible_icon_count_; |
| 134 | 135 |
| 135 content::NotificationRegistrar registrar_; | 136 content::NotificationRegistrar registrar_; |
| 136 | 137 |
| 137 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); | 138 DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarModel); |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 141 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |