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/media/router/presentation_service_delegate_impl.h" | 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <unordered_map> | 8 #include <unordered_map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 render_frame_host_id.first, render_frame_host_id.second); | 60 render_frame_host_id.first, render_frame_host_id.second); |
61 DCHECK(render_frame_host); | 61 DCHECK(render_frame_host); |
62 return render_frame_host->GetLastCommittedOrigin(); | 62 return render_frame_host->GetLastCommittedOrigin(); |
63 } | 63 } |
64 | 64 |
65 bool ArePresentationRequestsEqual( | 65 bool ArePresentationRequestsEqual( |
66 const content::PresentationRequest& request1, | 66 const content::PresentationRequest& request1, |
67 const content::PresentationRequest& request2) { | 67 const content::PresentationRequest& request2) { |
68 return request1.render_frame_host_id == request2.render_frame_host_id && | 68 return request1.render_frame_host_id == request2.render_frame_host_id && |
69 request1.presentation_urls == request2.presentation_urls && | 69 request1.presentation_urls == request2.presentation_urls && |
70 ((request1.frame_origin.unique() && request2.frame_origin.unique()) || | 70 ((request1.frame_origin.opaque() && request2.frame_origin.opaque()) || |
71 (request1.frame_origin == request2.frame_origin)); | 71 (request1.frame_origin == request2.frame_origin)); |
72 } | 72 } |
73 | 73 |
74 } // namespace | 74 } // namespace |
75 | 75 |
76 // PresentationFrame interfaces with MediaRouter to maintain the current state | 76 // PresentationFrame interfaces with MediaRouter to maintain the current state |
77 // of Presentation API within a single render frame, such as the set of | 77 // of Presentation API within a single render frame, such as the set of |
78 // PresentationAvailability listeners and PresentationConnections. | 78 // PresentationAvailability listeners and PresentationConnections. |
79 // Instances are lazily created when certain Presentation API is invoked on a | 79 // Instances are lazily created when certain Presentation API is invoked on a |
80 // frame, and are owned by PresentationServiceDelegateImpl. | 80 // frame, and are owned by PresentationServiceDelegateImpl. |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 const base::ListValue* origins = | 703 const base::ListValue* origins = |
704 Profile::FromBrowserContext(web_contents_->GetBrowserContext()) | 704 Profile::FromBrowserContext(web_contents_->GetBrowserContext()) |
705 ->GetPrefs() | 705 ->GetPrefs() |
706 ->GetList(prefs::kMediaRouterTabMirroringSources); | 706 ->GetList(prefs::kMediaRouterTabMirroringSources); |
707 return origins && | 707 return origins && |
708 origins->Find(base::Value(origin.Serialize())) != origins->end(); | 708 origins->Find(base::Value(origin.Serialize())) != origins->end(); |
709 } | 709 } |
710 #endif // !defined(OS_ANDROID) | 710 #endif // !defined(OS_ANDROID) |
711 | 711 |
712 } // namespace media_router | 712 } // namespace media_router |
OLD | NEW |