| 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 "ash/common/system/chromeos/cast/tray_cast.h" | 5 #include "ash/common/system/chromeos/cast/tray_cast.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 scroll_content()->SizeToPreferredSize(); | 395 scroll_content()->SizeToPreferredSize(); |
| 396 scroller()->Layout(); | 396 scroller()->Layout(); |
| 397 } | 397 } |
| 398 | 398 |
| 399 views::View* CastDetailedView::AddToReceiverList( | 399 views::View* CastDetailedView::AddToReceiverList( |
| 400 const ash::mojom::SinkAndRoutePtr& sink_route) { | 400 const ash::mojom::SinkAndRoutePtr& sink_route) { |
| 401 const gfx::ImageSkia image = | 401 const gfx::ImageSkia image = |
| 402 gfx::CreateVectorIcon(kSystemMenuCastDeviceIcon, kMenuIconColor); | 402 gfx::CreateVectorIcon(kSystemMenuCastDeviceIcon, kMenuIconColor); |
| 403 | 403 |
| 404 HoverHighlightView* container = new HoverHighlightView(this); | 404 HoverHighlightView* container = new HoverHighlightView(this); |
| 405 container->AddIconAndLabelCustomSize( | 405 container->AddIconAndLabel(image, base::UTF8ToUTF16(sink_route->sink->name)); |
| 406 image, base::UTF8ToUTF16(sink_route->sink->name), false, | |
| 407 kTrayPopupDetailsIconWidth, kTrayPopupPaddingHorizontal, | |
| 408 kTrayPopupPaddingBetweenItems); | |
| 409 | 406 |
| 410 scroll_content()->AddChildView(container); | 407 scroll_content()->AddChildView(container); |
| 411 return container; | 408 return container; |
| 412 } | 409 } |
| 413 | 410 |
| 414 void CastDetailedView::HandleViewClicked(views::View* view) { | 411 void CastDetailedView::HandleViewClicked(views::View* view) { |
| 415 // Find the receiver we are going to cast to. | 412 // Find the receiver we are going to cast to. |
| 416 auto it = view_to_sink_map_.find(view); | 413 auto it = view_to_sink_map_.find(view); |
| 417 if (it != view_to_sink_map_.end()) { | 414 if (it != view_to_sink_map_.end()) { |
| 418 Shell::Get()->cast_config()->CastToSink(it->second.Clone()); | 415 Shell::Get()->cast_config()->CastToSink(it->second.Clone()); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 528 |
| 532 return false; | 529 return false; |
| 533 } | 530 } |
| 534 | 531 |
| 535 void TrayCast::OnCastingSessionStartedOrStopped(bool started) { | 532 void TrayCast::OnCastingSessionStartedOrStopped(bool started) { |
| 536 is_mirror_casting_ = started; | 533 is_mirror_casting_ = started; |
| 537 UpdatePrimaryView(); | 534 UpdatePrimaryView(); |
| 538 } | 535 } |
| 539 | 536 |
| 540 } // namespace ash | 537 } // namespace ash |
| OLD | NEW |