| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool WantsToRun(content::WebContents* web_contents) const override; | 54 bool WantsToRun(content::WebContents* web_contents) const override; |
| 55 bool HasPopup(content::WebContents* web_contents) const override; | 55 bool HasPopup(content::WebContents* web_contents) const override; |
| 56 void HidePopup() override; | 56 void HidePopup() override; |
| 57 gfx::NativeView GetPopupNativeView() override; | 57 gfx::NativeView GetPopupNativeView() override; |
| 58 ui::MenuModel* GetContextMenu() override; | 58 ui::MenuModel* GetContextMenu() override; |
| 59 bool ExecuteAction(bool by_user) override; | 59 bool ExecuteAction(bool by_user) override; |
| 60 void UpdateState() override; | 60 void UpdateState() override; |
| 61 bool DisabledClickOpensMenu() const override; | 61 bool DisabledClickOpensMenu() const override; |
| 62 | 62 |
| 63 // media_router::IssuesObserver: | 63 // media_router::IssuesObserver: |
| 64 void OnIssueUpdated(const media_router::Issue* issue) override; | 64 void OnIssue(const media_router::Issue& issue) override; |
| 65 void OnIssuesCleared() override; |
| 65 | 66 |
| 66 // media_router::MediaRoutesObserver: | 67 // media_router::MediaRoutesObserver: |
| 67 void OnRoutesUpdated(const std::vector<media_router::MediaRoute>& routes, | 68 void OnRoutesUpdated(const std::vector<media_router::MediaRoute>& routes, |
| 68 const std::vector<media_router::MediaRoute::Id>& | 69 const std::vector<media_router::MediaRoute::Id>& |
| 69 joinable_route_ids) override; | 70 joinable_route_ids) override; |
| 70 | 71 |
| 71 // ToolbarStripModelObserver: | 72 // ToolbarStripModelObserver: |
| 72 void ActiveTabChanged(content::WebContents* old_contents, | 73 void ActiveTabChanged(content::WebContents* old_contents, |
| 73 content::WebContents* new_contents, | 74 content::WebContents* new_contents, |
| 74 int index, | 75 int index, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 104 // Checks if the current icon of MediaRouterAction has changed. If so, | 105 // Checks if the current icon of MediaRouterAction has changed. If so, |
| 105 // updates |current_icon_|. | 106 // updates |current_icon_|. |
| 106 void MaybeUpdateIcon(); | 107 void MaybeUpdateIcon(); |
| 107 | 108 |
| 108 gfx::VectorIconId GetCurrentIcon() const; | 109 gfx::VectorIconId GetCurrentIcon() const; |
| 109 | 110 |
| 110 // The current icon to show. This is updated based on the current issues and | 111 // The current icon to show. This is updated based on the current issues and |
| 111 // routes since |this| is an IssueObserver and MediaRoutesObserver. | 112 // routes since |this| is an IssueObserver and MediaRoutesObserver. |
| 112 gfx::VectorIconId current_icon_; | 113 gfx::VectorIconId current_icon_; |
| 113 | 114 |
| 114 // The current issue shown in the Media Router WebUI. Can be null. It is set | 115 // The current issue shown in the Media Router WebUI, set in OnIssue() and |
| 115 // in OnIssueUpdated(), which is called by the IssueManager. | 116 // cleared in OnIssuesCleared(). |
| 116 std::unique_ptr<media_router::Issue> issue_; | 117 std::unique_ptr<media_router::IssueInfo> current_issue_; |
| 117 | 118 |
| 118 // Whether a local displayable active route exists. | 119 // Whether a local displayable active route exists. |
| 119 bool has_local_display_route_; | 120 bool has_local_display_route_; |
| 120 | 121 |
| 121 // Whether the Media Router dialog is shown in the current tab. | 122 // Whether the Media Router dialog is shown in the current tab. |
| 122 // This should only be updated in OnDialogShown() and OnDialogHidden(). | 123 // This should only be updated in OnDialogShown() and OnDialogHidden(). |
| 123 bool has_dialog_; | 124 bool has_dialog_; |
| 124 | 125 |
| 125 ToolbarActionViewDelegate* delegate_; | 126 ToolbarActionViewDelegate* delegate_; |
| 126 | 127 |
| 127 Browser* const browser_; | 128 Browser* const browser_; |
| 128 ToolbarActionsBar* const toolbar_actions_bar_; | 129 ToolbarActionsBar* const toolbar_actions_bar_; |
| 129 | 130 |
| 130 // The delegate to handle platform-specific implementations. | 131 // The delegate to handle platform-specific implementations. |
| 131 std::unique_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; | 132 std::unique_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; |
| 132 | 133 |
| 133 MediaRouterContextualMenu contextual_menu_; | 134 MediaRouterContextualMenu contextual_menu_; |
| 134 | 135 |
| 135 ScopedObserver<TabStripModel, TabStripModelObserver> | 136 ScopedObserver<TabStripModel, TabStripModelObserver> |
| 136 tab_strip_model_observer_; | 137 tab_strip_model_observer_; |
| 137 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver> | 138 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver> |
| 138 toolbar_actions_bar_observer_; | 139 toolbar_actions_bar_observer_; |
| 139 | 140 |
| 140 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_; | 141 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_; |
| 141 | 142 |
| 142 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); | 143 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); |
| 143 }; | 144 }; |
| 144 | 145 |
| 145 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ | 146 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ |
| OLD | NEW |