| OLD | NEW |
| 1 // Copyright (c) 2009 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 | 7 |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
| 10 #include "chrome/common/notification_observer.h" | 10 #include "chrome/common/notification_observer.h" |
| 11 #include "chrome/common/notification_registrar.h" | 11 #include "chrome/common/notification_registrar.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 // The browser action button for |extension| has been moved to |index|. | 32 // The browser action button for |extension| has been moved to |index|. |
| 33 virtual void BrowserActionMoved(Extension* extension, int index) {} | 33 virtual void BrowserActionMoved(Extension* extension, int index) {} |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Functions called by the view. | 36 // Functions called by the view. |
| 37 void AddObserver(Observer* observer); | 37 void AddObserver(Observer* observer); |
| 38 void RemoveObserver(Observer* observer); | 38 void RemoveObserver(Observer* observer); |
| 39 void MoveBrowserAction(Extension* extension, int index); | 39 void MoveBrowserAction(Extension* extension, int index); |
| 40 | 40 |
| 41 size_t size() const { |
| 42 return toolitems_.size(); |
| 43 } |
| 44 |
| 41 ExtensionList::iterator begin() { | 45 ExtensionList::iterator begin() { |
| 42 return toolitems_.begin(); | 46 return toolitems_.begin(); |
| 43 } | 47 } |
| 44 | 48 |
| 45 ExtensionList::iterator end() { | 49 ExtensionList::iterator end() { |
| 46 return toolitems_.end(); | 50 return toolitems_.end(); |
| 47 } | 51 } |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 // NotificationObserver implementation. | 54 // NotificationObserver implementation. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 // Our ExtensionsService, guaranteed to outlive us. | 73 // Our ExtensionsService, guaranteed to outlive us. |
| 70 ExtensionsService* service_; | 74 ExtensionsService* service_; |
| 71 | 75 |
| 72 // Ordered list of browser action buttons. | 76 // Ordered list of browser action buttons. |
| 73 ExtensionList toolitems_; | 77 ExtensionList toolitems_; |
| 74 | 78 |
| 75 NotificationRegistrar registrar_; | 79 NotificationRegistrar registrar_; |
| 76 }; | 80 }; |
| 77 | 81 |
| 78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ | 82 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TOOLBAR_MODEL_H_ |
| OLD | NEW |