| 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 class MediaRouterAction; |
| 13 | 14 |
| 14 // The class for the contextual menu for the Media Router action. | 15 // The class for the contextual menu for the Media Router action. |
| 15 class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { | 16 class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { |
| 16 public: | 17 public: |
| 17 explicit MediaRouterContextualMenu(Browser* browser); | 18 explicit MediaRouterContextualMenu(Browser* browser); |
| 18 ~MediaRouterContextualMenu() override; | 19 ~MediaRouterContextualMenu() override; |
| 19 | 20 |
| 20 ui::MenuModel* menu_model() { return &menu_model_; } | 21 ui::MenuModel* menu_model() { return &menu_model_; } |
| 22 void SetMediaRouterAction(MediaRouterAction* action); |
| 21 | 23 |
| 22 private: | 24 private: |
| 23 // ui::SimpleMenuModel::Delegate: | 25 // ui::SimpleMenuModel::Delegate: |
| 24 bool IsCommandIdChecked(int command_id) const override; | 26 bool IsCommandIdChecked(int command_id) const override; |
| 25 bool IsCommandIdEnabled(int command_id) const override; | 27 bool IsCommandIdEnabled(int command_id) const override; |
| 26 bool IsCommandIdVisible(int command_id) const override; | 28 bool IsCommandIdVisible(int command_id) const override; |
| 27 void ExecuteCommand(int command_id, int event_flags) override; | 29 void ExecuteCommand(int command_id, int event_flags) override; |
| 28 | 30 |
| 29 void ReportIssue(); | 31 void ReportIssue(); |
| 30 void RemoveMediaRouterComponentAction(); | |
| 31 | 32 |
| 32 Browser* browser_; | 33 Browser* browser_; |
| 33 ui::SimpleMenuModel menu_model_; | 34 ui::SimpleMenuModel menu_model_; |
| 35 MediaRouterAction* action_; |
| 34 | 36 |
| 35 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); | 37 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ | 40 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ |
| OLD | NEW |