Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: chrome/browser/ui/toolbar/media_router_contextual_menu.h

Issue 2332693003: Show media router toolbar icon ephemerally for active local routes and issues (Closed)
Patch Set: Address Devlin's comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 MediaRouterContextualMenu(Browser* browser, MediaRouterAction* action);
18 ~MediaRouterContextualMenu() override; 19 ~MediaRouterContextualMenu() override;
19 20
20 ui::MenuModel* menu_model() { return &menu_model_; } 21 ui::MenuModel* menu_model() { return &menu_model_; }
21 22
22 private: 23 private:
23 #if defined(GOOGLE_CHROME_BUILD) 24 #if defined(GOOGLE_CHROME_BUILD)
24 FRIEND_TEST_ALL_PREFIXES(MediaRouterContextualMenuUnitTest, 25 FRIEND_TEST_ALL_PREFIXES(MediaRouterContextualMenuUnitTest,
25 ToggleCloudServicesItem); 26 ToggleCloudServicesItem);
26 #endif // GOOGLE_CHROME_BUILD 27 #endif // GOOGLE_CHROME_BUILD
27 28
28 // ui::SimpleMenuModel::Delegate: 29 // ui::SimpleMenuModel::Delegate:
29 bool IsCommandIdChecked(int command_id) const override; 30 bool IsCommandIdChecked(int command_id) const override;
30 bool IsCommandIdEnabled(int command_id) const override; 31 bool IsCommandIdEnabled(int command_id) const override;
31 bool IsCommandIdVisible(int command_id) const override; 32 bool IsCommandIdVisible(int command_id) const override;
32 void ExecuteCommand(int command_id, int event_flags) override; 33 void ExecuteCommand(int command_id, int event_flags) override;
33 34
34 void ReportIssue(); 35 void ReportIssue();
35 void RemoveMediaRouterComponentAction();
36 36
37 Browser* browser_; 37 Browser* browser_;
imcheng 2016/09/16 21:47:49 Browser* const
takumif 2016/09/20 14:50:47 Done.
38 ui::SimpleMenuModel menu_model_; 38 ui::SimpleMenuModel menu_model_;
39 MediaRouterAction* action_;
imcheng 2016/09/16 21:47:49 MediaRouterAction* const
takumif 2016/09/20 14:50:47 Removed action_.
39 40
40 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu); 41 DISALLOW_COPY_AND_ASSIGN(MediaRouterContextualMenu);
41 }; 42 };
42 43
43 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_ 44 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_CONTEXTUAL_MENU_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698