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 "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" | 8 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" |
9 | 9 |
10 class Browser; | 10 class Browser; |
11 class MediaRouterActionPlatformDelegate; | 11 class MediaRouterActionPlatformDelegate; |
12 | 12 |
13 namespace media_router { | 13 namespace media_router { |
14 class MediaRouterDialogController; | 14 class MediaRouterDialogControllerImpl; |
15 } // namespace media_router | 15 } // namespace media_router |
16 | 16 |
17 // The class for the Media Router component action that will be shown in | 17 // The class for the Media Router component action that will be shown in |
18 // the toolbar. | 18 // the toolbar. |
19 class MediaRouterAction : public ToolbarActionViewController { | 19 class MediaRouterAction : public ToolbarActionViewController { |
20 public: | 20 public: |
21 explicit MediaRouterAction(Browser* browser); | 21 explicit MediaRouterAction(Browser* browser); |
22 ~MediaRouterAction() override; | 22 ~MediaRouterAction() override; |
23 | 23 |
24 // ToolbarActionViewController implementation. | 24 // ToolbarActionViewController implementation. |
(...skipping 14 matching lines...) Expand all Loading... | |
39 ui::MenuModel* GetContextMenu() override; | 39 ui::MenuModel* GetContextMenu() override; |
40 bool CanDrag() const override; | 40 bool CanDrag() const override; |
41 bool ExecuteAction(bool by_user) override; | 41 bool ExecuteAction(bool by_user) override; |
42 void UpdateState() override; | 42 void UpdateState() override; |
43 bool DisabledClickOpensMenu() const override; | 43 bool DisabledClickOpensMenu() const override; |
44 | 44 |
45 private: | 45 private: |
46 // Returns a reference to the MediaRouterDialogController associated with | 46 // Returns a reference to the MediaRouterDialogController associated with |
47 // |delegate_|'s current WebContents. Guaranteed to be non-null. | 47 // |delegate_|'s current WebContents. Guaranteed to be non-null. |
48 // |delegate_| and its current WebContents must not be null. | 48 // |delegate_| and its current WebContents must not be null. |
49 media_router::MediaRouterDialogController* GetMediaRouterDialogController(); | 49 media_router::MediaRouterDialogControllerImpl* |
mark a. foltz
2015/07/22 21:16:39
Why does this API need to be changed to use the im
whywhat
2015/07/22 22:55:01
Well, I assumed that webui/ classes can use the we
mark a. foltz
2015/07/22 23:05:55
Okay, if the methods make sense in the MediaRouter
| |
50 GetMediaRouterDialogController(); | |
50 | 51 |
51 const std::string id_; | 52 const std::string id_; |
52 const base::string16 name_; | 53 const base::string16 name_; |
53 | 54 |
54 // Cached icons. | 55 // Cached icons. |
55 gfx::Image media_router_idle_icon_; | 56 gfx::Image media_router_idle_icon_; |
56 | 57 |
57 ToolbarActionViewDelegate* delegate_; | 58 ToolbarActionViewDelegate* delegate_; |
58 | 59 |
59 // The delegate to handle platform-specific implementations. | 60 // The delegate to handle platform-specific implementations. |
60 scoped_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; | 61 scoped_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); | 63 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); |
63 }; | 64 }; |
64 | 65 |
65 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ | 66 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
OLD | NEW |