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_ACTION_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
7 | 7 |
8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
9 #include "chrome/browser/media/router/issues_observer.h" | 9 #include "chrome/browser/media/router/issues_observer.h" |
10 #include "chrome/browser/media/router/local_media_routes_observer.h" | 10 #include "chrome/browser/media/router/local_media_routes_observer.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
12 #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h" | 12 #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h" |
13 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" | 13 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" |
| 14 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
14 | 15 |
15 class Browser; | 16 class Browser; |
16 class MediaRouterActionPlatformDelegate; | 17 class MediaRouterActionPlatformDelegate; |
17 class TabStripModel; | 18 class TabStripModel; |
18 | 19 |
19 namespace media_router { | 20 namespace media_router { |
20 class MediaRouterDialogControllerImpl; | 21 class MediaRouterDialogControllerImpl; |
21 } // namespace media_router | 22 } // namespace media_router |
22 | 23 |
23 // The class for the Media Router component action that will be shown in | 24 // The class for the Media Router component action that will be shown in |
24 // the toolbar. | 25 // the toolbar. |
25 class MediaRouterAction : public ToolbarActionViewController, | 26 class MediaRouterAction : public ToolbarActionViewController, |
26 public media_router::IssuesObserver, | 27 public media_router::IssuesObserver, |
27 public media_router::LocalMediaRoutesObserver, | 28 public media_router::LocalMediaRoutesObserver, |
28 public TabStripModelObserver { | 29 public TabStripModelObserver { |
29 public: | 30 public: |
30 explicit MediaRouterAction(Browser* browser); | 31 MediaRouterAction(Browser* browser, ToolbarActionsBar* toolbar_actions_bar); |
31 ~MediaRouterAction() override; | 32 ~MediaRouterAction() override; |
32 | 33 |
33 // ToolbarActionViewController implementation. | 34 // ToolbarActionViewController implementation. |
34 std::string GetId() const override; | 35 std::string GetId() const override; |
35 void SetDelegate(ToolbarActionViewDelegate* delegate) override; | 36 void SetDelegate(ToolbarActionViewDelegate* delegate) override; |
36 gfx::Image GetIcon(content::WebContents* web_contents, | 37 gfx::Image GetIcon(content::WebContents* web_contents, |
37 const gfx::Size& size) override; | 38 const gfx::Size& size) override; |
38 base::string16 GetActionName() const override; | 39 base::string16 GetActionName() const override; |
39 base::string16 GetAccessibleName(content::WebContents* web_contents) | 40 base::string16 GetAccessibleName(content::WebContents* web_contents) |
40 const override; | 41 const override; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // The current issue shown in the Media Router WebUI. Can be null. It is set | 103 // The current issue shown in the Media Router WebUI. Can be null. It is set |
103 // in OnIssueUpdated(), which is called by the IssueManager. | 104 // in OnIssueUpdated(), which is called by the IssueManager. |
104 scoped_ptr<media_router::Issue> issue_; | 105 scoped_ptr<media_router::Issue> issue_; |
105 | 106 |
106 // Whether a local displayable active route exists. | 107 // Whether a local displayable active route exists. |
107 bool has_local_display_route_; | 108 bool has_local_display_route_; |
108 | 109 |
109 ToolbarActionViewDelegate* delegate_; | 110 ToolbarActionViewDelegate* delegate_; |
110 | 111 |
111 Browser* const browser_; | 112 Browser* const browser_; |
| 113 ToolbarActionsBar* const toolbar_actions_bar_; |
112 | 114 |
113 // The delegate to handle platform-specific implementations. | 115 // The delegate to handle platform-specific implementations. |
114 scoped_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; | 116 scoped_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; |
115 | 117 |
116 MediaRouterContextualMenu contextual_menu_; | 118 MediaRouterContextualMenu contextual_menu_; |
117 | 119 |
118 ScopedObserver<TabStripModel, TabStripModelObserver> | 120 ScopedObserver<TabStripModel, TabStripModelObserver> |
119 tab_strip_model_observer_; | 121 tab_strip_model_observer_; |
120 | 122 |
121 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_; | 123 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_; |
122 | 124 |
123 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); | 125 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); |
124 }; | 126 }; |
125 | 127 |
126 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ | 128 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
OLD | NEW |