Chromium Code Reviews| 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..3752be8166248c7bf925dc0d46f99d0bd928fc0b 100644 |
| --- a/chrome/browser/ui/toolbar/media_router_contextual_menu.h |
| +++ b/chrome/browser/ui/toolbar/media_router_contextual_menu.h |
| @@ -14,13 +14,19 @@ class Browser; |
| // The class for the contextual menu for the Media Router action. |
| class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { |
| public: |
| - explicit MediaRouterContextualMenu(Browser* browser); |
| + static std::unique_ptr<MediaRouterContextualMenu> CreateForToolbar( |
|
msw
2017/03/02 03:12:58
nit: add function comments here and below
takumif
2017/03/03 00:10:48
Done.
|
| + Browser* browser); |
| - // Constructor for injecting values in tests. |
| - MediaRouterContextualMenu(Browser* browser, bool shown_by_policy); |
| + static std::unique_ptr<MediaRouterContextualMenu> CreateForOverflowMenu( |
| + Browser* browser); |
| + |
| + // Constructor called by the static Create* methods above and tests. |
| + MediaRouterContextualMenu(Browser* browser, |
| + bool is_in_toolbar, |
|
msw
2017/03/02 03:12:58
optional nit: rename this and the new member |is_a
takumif
2017/03/03 00:10:48
Done.
|
| + 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, |
| @@ -41,10 +47,14 @@ class MediaRouterContextualMenu : public ui::SimpleMenuModel::Delegate { |
| void ExecuteCommand(int command_id, int event_flags) override; |
| void ReportIssue(); |
| + int GetChangeVisibilityTextId(); |
|
msw
2017/03/02 03:12:58
nit: add function comments for this and ReportIsss
takumif
2017/03/03 00:10:48
Done.
|
| Browser* const browser_; |
| ui::SimpleMenuModel menu_model_; |
| + // Whether the action icon is in the toolbar, as opposed to the overflow menu. |
| + const bool is_in_toolbar_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); |
| }; |