| Index: chrome/browser/ui/toolbar/media_router_contextual_menu.h
|
| diff --git a/chrome/browser/ui/toolbar/media_router_contextual_menu.h b/chrome/browser/ui/toolbar/media_router_contextual_menu.h
|
| index d70fc5086333d2816c1e50c1dfcacb6ee9b6bf92..ad6d44995111431698b5ad738d8e64615b249235 100644
|
| --- a/chrome/browser/ui/toolbar/media_router_contextual_menu.h
|
| +++ b/chrome/browser/ui/toolbar/media_router_contextual_menu.h
|
| @@ -14,13 +14,21 @@ class Browser;
|
| // The class for the contextual menu for the Media Router action.
|
| class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate {
|
| public:
|
| - explicit MediaRouterContextualMenu(Browser* browser);
|
| + // Creates an instance for a Media Router Action shown in the toolbar.
|
| + static std::unique_ptr<MediaRouterContextualMenu> CreateForToolbar(
|
| + Browser* browser);
|
|
|
| - // Constructor for injecting values in tests.
|
| - MediaRouterContextualMenu(Browser* browser, bool shown_by_policy);
|
| + // Creates an instance for a Media Router Action shown in the overflow menu.
|
| + static std::unique_ptr<MediaRouterContextualMenu> CreateForOverflowMenu(
|
| + Browser* browser);
|
| +
|
| + // Constructor called by the static Create* methods above and tests.
|
| + MediaRouterContextualMenu(Browser* browser,
|
| + bool is_action_in_toolbar,
|
| + bool shown_by_policy);
|
| ~MediaRouterContextualMenu() override;
|
|
|
| - ui::MenuModel* menu_model() { return &menu_model_; }
|
| + ui::SimpleMenuModel* menu_model() { return &menu_model_; }
|
|
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(MediaRouterContextualMenuUnitTest,
|
| @@ -40,11 +48,20 @@ class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate {
|
| bool IsCommandIdVisible(int command_id) const override;
|
| void ExecuteCommand(int command_id, int event_flags) override;
|
|
|
| + // Opens feedback page loaded from the media router extension.
|
| void ReportIssue();
|
|
|
| + // Gets the ID corresponding to the text for the menu option to change the
|
| + // visibility of the action (e.g. "Hide in Chrome menu" / "Show in toolbar")
|
| + // depending on the location of the action.
|
| + int GetChangeVisibilityTextId();
|
| +
|
| Browser* const browser_;
|
| ui::SimpleMenuModel menu_model_;
|
|
|
| + // Whether the action icon is in the toolbar, as opposed to the overflow menu.
|
| + const bool is_action_in_toolbar_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu);
|
| };
|
|
|
|
|