| 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/webui/media_router/media_router_ui.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 } | 718 } |
| 719 | 719 |
| 720 std::string MediaRouterUI::GetTruncatedPresentationRequestSourceName() const { | 720 std::string MediaRouterUI::GetTruncatedPresentationRequestSourceName() const { |
| 721 GURL gurl = GetFrameURL(); | 721 GURL gurl = GetFrameURL(); |
| 722 return gurl.SchemeIs(extensions::kExtensionScheme) | 722 return gurl.SchemeIs(extensions::kExtensionScheme) |
| 723 ? GetExtensionName(gurl, extensions::ExtensionRegistry::Get( | 723 ? GetExtensionName(gurl, extensions::ExtensionRegistry::Get( |
| 724 Profile::FromWebUI(web_ui()))) | 724 Profile::FromWebUI(web_ui()))) |
| 725 : TruncateHost(GetHostFromURL(gurl)); | 725 : TruncateHost(GetHostFromURL(gurl)); |
| 726 } | 726 } |
| 727 | 727 |
| 728 const std::set<MediaCastMode>& MediaRouterUI::cast_modes() const { |
| 729 return cast_modes_; |
| 730 } |
| 731 |
| 728 const std::string& MediaRouterUI::GetRouteProviderExtensionId() const { | 732 const std::string& MediaRouterUI::GetRouteProviderExtensionId() const { |
| 729 // TODO(crbug.com/597778): remove reference to MediaRouterMojoImpl | 733 // TODO(crbug.com/597778): remove reference to MediaRouterMojoImpl |
| 730 return static_cast<MediaRouterMojoImpl*>(router_) | 734 return static_cast<MediaRouterMojoImpl*>(router_) |
| 731 ->media_route_provider_extension_id(); | 735 ->media_route_provider_extension_id(); |
| 732 } | 736 } |
| 733 | 737 |
| 734 void MediaRouterUI::SetUIInitializationTimer(const base::Time& start_time) { | 738 void MediaRouterUI::SetUIInitializationTimer(const base::Time& start_time) { |
| 735 DCHECK(!start_time.is_null()); | 739 DCHECK(!start_time.is_null()); |
| 736 start_time_ = start_time; | 740 start_time_ = start_time; |
| 737 } | 741 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 756 } | 760 } |
| 757 | 761 |
| 758 std::string MediaRouterUI::GetSerializedInitiatorOrigin() const { | 762 std::string MediaRouterUI::GetSerializedInitiatorOrigin() const { |
| 759 url::Origin origin = initiator_ | 763 url::Origin origin = initiator_ |
| 760 ? url::Origin(initiator_->GetLastCommittedURL()) | 764 ? url::Origin(initiator_->GetLastCommittedURL()) |
| 761 : url::Origin(); | 765 : url::Origin(); |
| 762 return origin.Serialize(); | 766 return origin.Serialize(); |
| 763 } | 767 } |
| 764 | 768 |
| 765 } // namespace media_router | 769 } // namespace media_router |
| OLD | NEW |