| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/base/models/simple_menu_model.h" | 10 #include "ui/base/models/simple_menu_model.h" |
| 11 | 11 |
| 12 class Browser; | 12 class Browser; |
| 13 | 13 |
| 14 namespace extensions { | |
| 15 class ComponentMigrationHelper; | |
| 16 } // namespace extensions | |
| 17 | |
| 18 // The class for the contextual menu for the Media Router action. | 14 // The class for the contextual menu for the Media Router action. |
| 19 class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { | 15 class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { |
| 20 public: | 16 public: |
| 21 explicit MediaRouterContextualMenu(Browser* browser); | 17 explicit MediaRouterContextualMenu(Browser* browser); |
| 22 | 18 |
| 23 // Constructor for injecting values in tests. | 19 // Constructor for injecting values in tests. |
| 24 MediaRouterContextualMenu(Browser* browser, bool shown_by_policy); | 20 MediaRouterContextualMenu(Browser* browser, bool shown_by_policy); |
| 25 ~MediaRouterContextualMenu() override; | 21 ~MediaRouterContextualMenu() override; |
| 26 | 22 |
| 27 ui::MenuModel* menu_model() { return &menu_model_; } | 23 ui::MenuModel* menu_model() { return &menu_model_; } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 // ui::SimpleMenuModel::Delegate: | 37 // ui::SimpleMenuModel::Delegate: |
| 42 bool IsCommandIdChecked(int command_id) const override; | 38 bool IsCommandIdChecked(int command_id) const override; |
| 43 bool IsCommandIdEnabled(int command_id) const override; | 39 bool IsCommandIdEnabled(int command_id) const override; |
| 44 bool IsCommandIdVisible(int command_id) const override; | 40 bool IsCommandIdVisible(int command_id) const override; |
| 45 void ExecuteCommand(int command_id, int event_flags) override; | 41 void ExecuteCommand(int command_id, int event_flags) override; |
| 46 | 42 |
| 47 void ReportIssue(); | 43 void ReportIssue(); |
| 48 | 44 |
| 49 Browser* const browser_; | 45 Browser* const browser_; |
| 50 ui::SimpleMenuModel menu_model_; | 46 ui::SimpleMenuModel menu_model_; |
| 51 extensions::ComponentMigrationHelper* const component_migration_helper_; | |
| 52 | 47 |
| 53 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); | 48 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); |
| 54 }; | 49 }; |
| 55 | 50 |
| 56 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ | 51 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ |
| OLD | NEW |