| 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 namespace media_router { | 10 namespace media_router { |
| 11 class MediaRouterDialogController; | 11 class MediaRouterDialogControllerImpl; |
| 12 } // namespace media_router | 12 } // namespace media_router |
| 13 | 13 |
| 14 // The class for the Media Router component action that will be shown in | 14 // The class for the Media Router component action that will be shown in |
| 15 // the toolbar. | 15 // the toolbar. |
| 16 class MediaRouterAction : public ToolbarActionViewController { | 16 class MediaRouterAction : public ToolbarActionViewController { |
| 17 public: | 17 public: |
| 18 MediaRouterAction(); | 18 MediaRouterAction(); |
| 19 ~MediaRouterAction() override; | 19 ~MediaRouterAction() override; |
| 20 | 20 |
| 21 // ToolbarActionViewController implementation. | 21 // ToolbarActionViewController implementation. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 36 ui::MenuModel* GetContextMenu() override; | 36 ui::MenuModel* GetContextMenu() override; |
| 37 bool CanDrag() const override; | 37 bool CanDrag() const override; |
| 38 bool ExecuteAction(bool by_user) override; | 38 bool ExecuteAction(bool by_user) override; |
| 39 void UpdateState() override; | 39 void UpdateState() override; |
| 40 bool DisabledClickOpensMenu() const override; | 40 bool DisabledClickOpensMenu() const override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // Returns a reference to the MediaRouterDialogController associated with | 43 // Returns a reference to the MediaRouterDialogController associated with |
| 44 // |delegate_|'s current WebContents. Guaranteed to be non-null. | 44 // |delegate_|'s current WebContents. Guaranteed to be non-null. |
| 45 // |delegate_| and its current WebContents must not be null. | 45 // |delegate_| and its current WebContents must not be null. |
| 46 media_router::MediaRouterDialogController* GetMediaRouterDialogController(); | 46 media_router::MediaRouterDialogControllerImpl* |
| 47 GetMediaRouterDialogController(); |
| 47 | 48 |
| 48 const std::string id_; | 49 const std::string id_; |
| 49 const base::string16 name_; | 50 const base::string16 name_; |
| 50 | 51 |
| 51 // Cached icons. | 52 // Cached icons. |
| 52 gfx::Image media_router_idle_icon_; | 53 gfx::Image media_router_idle_icon_; |
| 53 | 54 |
| 54 ToolbarActionViewDelegate* delegate_; | 55 ToolbarActionViewDelegate* delegate_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); | 57 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ | 60 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
| OLD | NEW |