OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "ui/base/models/simple_menu_model.h" |
| 13 |
| 14 namespace extensions { |
| 15 class Extension; |
| 16 } |
| 17 |
| 18 // A menu model that builds the contents of the action box menu. |
| 19 class ActionBoxMenuModel : public ui::SimpleMenuModel, |
| 20 public content::NotificationObserver { |
| 21 public: |
| 22 explicit ActionBoxMenuModel(ExtensionService* extension_service); |
| 23 virtual ~ActionBoxMenuModel(); |
| 24 |
| 25 const extensions::ExtensionList& action_box_menu_items() { |
| 26 return extension_service_->toolbar_model()->action_box_menu_items(); |
| 27 } |
| 28 |
| 29 private: |
| 30 typedef std::map<int, std::string> IdToEntensionIdMap; |
| 31 |
| 32 // Overridden from content::NotificationObserver: |
| 33 virtual void Observe(int type, |
| 34 const content::NotificationSource& source, |
| 35 const content::NotificationDetails& details) OVERRIDE; |
| 36 |
| 37 ExtensionService* extension_service_; |
| 38 |
| 39 IdToEntensionIdMap id_to_extension_id_map_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(ActionBoxMenuModel); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_UI_TOOLBAR_ACTION_BOX_MENU_MODEL_H_ |
OLD | NEW |