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 #include "chrome/browser/ui/toolbar/media_router_action.h" | 5 #include "chrome/browser/ui/toolbar/media_router_action.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/media/router/issue.h" | 8 #include "chrome/browser/media/router/issue.h" |
9 #include "chrome/browser/media/router/media_route.h" | 9 #include "chrome/browser/media/router/media_route.h" |
10 #include "chrome/browser/media/router/media_router.h" | 10 #include "chrome/browser/media/router/media_router.h" |
(...skipping 29 matching lines...) Expand all Loading... | |
40 .GetImageNamed(IDR_MEDIA_ROUTER_WARNING_ICON)), | 40 .GetImageNamed(IDR_MEDIA_ROUTER_WARNING_ICON)), |
41 current_icon_(&media_router_idle_icon_), | 41 current_icon_(&media_router_idle_icon_), |
42 has_local_route_(false), | 42 has_local_route_(false), |
43 delegate_(nullptr), | 43 delegate_(nullptr), |
44 platform_delegate_(MediaRouterActionPlatformDelegate::Create(browser)), | 44 platform_delegate_(MediaRouterActionPlatformDelegate::Create(browser)), |
45 contextual_menu_(browser) {} | 45 contextual_menu_(browser) {} |
46 | 46 |
47 MediaRouterAction::~MediaRouterAction() { | 47 MediaRouterAction::~MediaRouterAction() { |
48 } | 48 } |
49 | 49 |
50 const std::string& MediaRouterAction::GetId() const { | 50 std::string MediaRouterAction::GetId() const { |
51 return id_; | 51 return id_; |
Peter Kasting
2015/08/21 18:51:55
You can eliminate |id_| and return ComponentToolba
apacible
2015/08/21 21:11:59
Done. I was going to do this in a separate patch t
| |
52 } | 52 } |
53 | 53 |
54 void MediaRouterAction::SetDelegate(ToolbarActionViewDelegate* delegate) { | 54 void MediaRouterAction::SetDelegate(ToolbarActionViewDelegate* delegate) { |
55 delegate_ = delegate; | 55 delegate_ = delegate; |
56 } | 56 } |
57 | 57 |
58 gfx::Image MediaRouterAction::GetIcon(content::WebContents* web_contents, | 58 gfx::Image MediaRouterAction::GetIcon(content::WebContents* web_contents, |
59 const gfx::Size& size) { | 59 const gfx::Size& size) { |
60 return *current_icon_; | 60 return *current_icon_; |
61 } | 61 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 if (issue_) { | 169 if (issue_) { |
170 if (issue_->severity() == media_router::Issue::FATAL) | 170 if (issue_->severity() == media_router::Issue::FATAL) |
171 return &media_router_error_icon_; | 171 return &media_router_error_icon_; |
172 if (issue_->severity() == media_router::Issue::WARNING) | 172 if (issue_->severity() == media_router::Issue::WARNING) |
173 return &media_router_warning_icon_; | 173 return &media_router_warning_icon_; |
174 } | 174 } |
175 | 175 |
176 return has_local_route_ ? | 176 return has_local_route_ ? |
177 &media_router_active_icon_ : &media_router_idle_icon_; | 177 &media_router_active_icon_ : &media_router_idle_icon_; |
178 } | 178 } |
OLD | NEW |