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

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

Issue 2176613003: [Media Router] Clean up issues related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IssueObserver init behavior and use StructTraits Created 4 years, 2 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_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
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/optional.h"
12 #include "base/scoped_observer.h" 13 #include "base/scoped_observer.h"
13 #include "chrome/browser/media/router/issues_observer.h" 14 #include "chrome/browser/media/router/issues_observer.h"
14 #include "chrome/browser/media/router/media_routes_observer.h" 15 #include "chrome/browser/media/router/media_routes_observer.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" 16 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
16 #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h" 17 #include "chrome/browser/ui/toolbar/media_router_contextual_menu.h"
17 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 18 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
18 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" 19 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
19 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_observer.h" 20 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_observer.h"
20 #include "ui/gfx/vector_icons_public.h" 21 #include "ui/gfx/vector_icons_public.h"
21 22
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 severity of the current issue shown in the Media Router WebUI, or not
115 // in OnIssueUpdated(), which is called by the IssueManager. 116 // set if there are no issues currently.
116 std::unique_ptr<media_router::Issue> issue_; 117 // Set in OnIssueUpdated(), which is called by the IssueManager.
118 base::Optional<media_router::IssueInfo::Severity> current_issue_severity_;
mark a. foltz 2016/10/18 21:13:44 It seems odd to cherry-pick one value out of the d
imcheng 2016/11/18 23:45:14 This was an issue before because of how we allocat
117 119
118 // Whether a local displayable active route exists. 120 // Whether a local displayable active route exists.
119 bool has_local_display_route_; 121 bool has_local_display_route_;
120 122
121 // Whether the Media Router dialog is shown in the current tab. 123 // Whether the Media Router dialog is shown in the current tab.
122 // This should only be updated in OnDialogShown() and OnDialogHidden(). 124 // This should only be updated in OnDialogShown() and OnDialogHidden().
123 bool has_dialog_; 125 bool has_dialog_;
124 126
125 ToolbarActionViewDelegate* delegate_; 127 ToolbarActionViewDelegate* delegate_;
126 128
127 Browser* const browser_; 129 Browser* const browser_;
128 ToolbarActionsBar* const toolbar_actions_bar_; 130 ToolbarActionsBar* const toolbar_actions_bar_;
129 131
130 // The delegate to handle platform-specific implementations. 132 // The delegate to handle platform-specific implementations.
131 std::unique_ptr<MediaRouterActionPlatformDelegate> platform_delegate_; 133 std::unique_ptr<MediaRouterActionPlatformDelegate> platform_delegate_;
132 134
133 MediaRouterContextualMenu contextual_menu_; 135 MediaRouterContextualMenu contextual_menu_;
134 136
135 ScopedObserver<TabStripModel, TabStripModelObserver> 137 ScopedObserver<TabStripModel, TabStripModelObserver>
136 tab_strip_model_observer_; 138 tab_strip_model_observer_;
137 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver> 139 ScopedObserver<ToolbarActionsBar, ToolbarActionsBarObserver>
138 toolbar_actions_bar_observer_; 140 toolbar_actions_bar_observer_;
139 141
140 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_; 142 base::WeakPtrFactory<MediaRouterAction> weak_ptr_factory_;
141 143
142 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction); 144 DISALLOW_COPY_AND_ASSIGN(MediaRouterAction);
143 }; 145 };
144 146
145 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_ 147 #endif // CHROME_BROWSER_UI_TOOLBAR_MEDIA_ROUTER_ACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698