| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 views::View* CastDetailedView::AddToReceiverList( | 426 views::View* CastDetailedView::AddToReceiverList( |
| 427 const ash::mojom::SinkAndRoutePtr& sink_route) { | 427 const ash::mojom::SinkAndRoutePtr& sink_route) { |
| 428 const gfx::ImageSkia image = | 428 const gfx::ImageSkia image = |
| 429 MaterialDesignController::IsSystemTrayMenuMaterial() | 429 MaterialDesignController::IsSystemTrayMenuMaterial() |
| 430 ? gfx::CreateVectorIcon(kSystemMenuCastDeviceIcon, kMenuIconColor) | 430 ? gfx::CreateVectorIcon(kSystemMenuCastDeviceIcon, kMenuIconColor) |
| 431 : *ui::ResourceBundle::GetSharedInstance() | 431 : *ui::ResourceBundle::GetSharedInstance() |
| 432 .GetImageNamed(IDR_AURA_UBER_TRAY_CAST_DEVICE_ICON) | 432 .GetImageNamed(IDR_AURA_UBER_TRAY_CAST_DEVICE_ICON) |
| 433 .ToImageSkia(); | 433 .ToImageSkia(); |
| 434 | 434 |
| 435 HoverHighlightView* container = new HoverHighlightView(this); | 435 HoverHighlightView* container = new HoverHighlightView(this); |
| 436 container->AddIconAndLabelCustomSize( | 436 container->AddIconAndLabel(image, base::UTF8ToUTF16(sink_route->sink->name)); |
| 437 image, base::UTF8ToUTF16(sink_route->sink->name), false, | |
| 438 kTrayPopupDetailsIconWidth, kTrayPopupPaddingHorizontal, | |
| 439 kTrayPopupPaddingBetweenItems); | |
| 440 | 437 |
| 441 scroll_content()->AddChildView(container); | 438 scroll_content()->AddChildView(container); |
| 442 return container; | 439 return container; |
| 443 } | 440 } |
| 444 | 441 |
| 445 void CastDetailedView::HandleViewClicked(views::View* view) { | 442 void CastDetailedView::HandleViewClicked(views::View* view) { |
| 446 // Find the receiver we are going to cast to. | 443 // Find the receiver we are going to cast to. |
| 447 auto it = view_to_sink_map_.find(view); | 444 auto it = view_to_sink_map_.find(view); |
| 448 if (it != view_to_sink_map_.end()) { | 445 if (it != view_to_sink_map_.end()) { |
| 449 WmShell::Get()->cast_config()->CastToSink(it->second.Clone()); | 446 WmShell::Get()->cast_config()->CastToSink(it->second.Clone()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 | 560 |
| 564 return false; | 561 return false; |
| 565 } | 562 } |
| 566 | 563 |
| 567 void TrayCast::OnCastingSessionStartedOrStopped(bool started) { | 564 void TrayCast::OnCastingSessionStartedOrStopped(bool started) { |
| 568 is_mirror_casting_ = started; | 565 is_mirror_casting_ = started; |
| 569 UpdatePrimaryView(); | 566 UpdatePrimaryView(); |
| 570 } | 567 } |
| 571 | 568 |
| 572 } // namespace ash | 569 } // namespace ash |
| OLD | NEW |