OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/guest_view/browser/guest_view_manager.h" | 5 #include "components/guest_view/browser/guest_view_manager.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 } | 230 } |
231 | 231 |
232 WebContents* GuestViewManager::GetFullPageGuest( | 232 WebContents* GuestViewManager::GetFullPageGuest( |
233 WebContents* embedder_web_contents) { | 233 WebContents* embedder_web_contents) { |
234 WebContents* result = nullptr; | 234 WebContents* result = nullptr; |
235 ForEachGuest(embedder_web_contents, | 235 ForEachGuest(embedder_web_contents, |
236 base::Bind(&GuestViewManager::GetFullPageGuestHelper, &result)); | 236 base::Bind(&GuestViewManager::GetFullPageGuestHelper, &result)); |
237 return result; | 237 return result; |
238 } | 238 } |
239 | 239 |
| 240 bool GuestViewManager::IsForMimeHandlerViewGuest( |
| 241 content::WebContents* web_contents) { |
| 242 GuestViewBase* guest = GuestViewBase::FromWebContents(web_contents); |
| 243 return guest && guest->IsMimeHandlerViewGuest(); |
| 244 } |
| 245 |
240 void GuestViewManager::AddGuest(int guest_instance_id, | 246 void GuestViewManager::AddGuest(int guest_instance_id, |
241 WebContents* guest_web_contents) { | 247 WebContents* guest_web_contents) { |
242 CHECK(!ContainsKey(guest_web_contents_by_instance_id_, guest_instance_id)); | 248 CHECK(!ContainsKey(guest_web_contents_by_instance_id_, guest_instance_id)); |
243 CHECK(CanUseGuestInstanceID(guest_instance_id)); | 249 CHECK(CanUseGuestInstanceID(guest_instance_id)); |
244 guest_web_contents_by_instance_id_[guest_instance_id] = guest_web_contents; | 250 guest_web_contents_by_instance_id_[guest_instance_id] = guest_web_contents; |
245 | 251 |
246 delegate_->OnGuestAdded(guest_web_contents); | 252 delegate_->OnGuestAdded(guest_web_contents); |
247 } | 253 } |
248 | 254 |
249 void GuestViewManager::RemoveGuest(int guest_instance_id) { | 255 void GuestViewManager::RemoveGuest(int guest_instance_id) { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 const GuestViewCreateFunction& create_function, | 500 const GuestViewCreateFunction& create_function, |
495 const GuestViewCleanUpFunction& cleanup_function) | 501 const GuestViewCleanUpFunction& cleanup_function) |
496 : create_function(create_function), cleanup_function(cleanup_function) {} | 502 : create_function(create_function), cleanup_function(cleanup_function) {} |
497 | 503 |
498 GuestViewManager::GuestViewData::GuestViewData(const GuestViewData& other) = | 504 GuestViewManager::GuestViewData::GuestViewData(const GuestViewData& other) = |
499 default; | 505 default; |
500 | 506 |
501 GuestViewManager::GuestViewData::~GuestViewData() {} | 507 GuestViewManager::GuestViewData::~GuestViewData() {} |
502 | 508 |
503 } // namespace guest_view | 509 } // namespace guest_view |
OLD | NEW |