| 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 "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h
" | 5 #include "extensions/browser/guest_view/extensions_guest_view_manager_delegate.h
" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "components/guest_view/browser/guest_view_base.h" | 9 #include "components/guest_view/browser/guest_view_base.h" |
| 10 #include "components/guest_view/browser/guest_view_manager.h" | 10 #include "components/guest_view/browser/guest_view_manager.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 EventRouter::DispatchEventToSender(owner, guest->browser_context(), | 60 EventRouter::DispatchEventToSender(owner, guest->browser_context(), |
| 61 guest->owner_host(), histogram_value, | 61 guest->owner_host(), histogram_value, |
| 62 event_name, std::move(event_args), | 62 event_name, std::move(event_args), |
| 63 EventRouter::USER_GESTURE_UNKNOWN, info); | 63 EventRouter::USER_GESTURE_UNKNOWN, info); |
| 64 } | 64 } |
| 65 | 65 |
| 66 bool ExtensionsGuestViewManagerDelegate::IsGuestAvailableToContext( | 66 bool ExtensionsGuestViewManagerDelegate::IsGuestAvailableToContext( |
| 67 GuestViewBase* guest) { | 67 GuestViewBase* guest) { |
| 68 const Feature* feature = | 68 const Feature* feature = |
| 69 FeatureProvider::GetAPIFeature(guest->GetAPINamespace()); | 69 FeatureProvider::GetAPIFeature(guest->GetAPINamespace()); |
| 70 CHECK(feature); | 70 if (!feature) |
| 71 return false; |
| 71 | 72 |
| 72 ProcessMap* process_map = ProcessMap::Get(context_); | 73 ProcessMap* process_map = ProcessMap::Get(context_); |
| 73 CHECK(process_map); | 74 CHECK(process_map); |
| 74 | 75 |
| 75 const Extension* owner_extension = ProcessManager::Get(context_)-> | 76 const Extension* owner_extension = ProcessManager::Get(context_)-> |
| 76 GetExtensionForWebContents(guest->owner_web_contents()); | 77 GetExtensionForWebContents(guest->owner_web_contents()); |
| 77 | 78 |
| 78 // Ok for |owner_extension| to be nullptr, the embedder might be WebUI. | 79 // Ok for |owner_extension| to be nullptr, the embedder might be WebUI. |
| 79 Feature::Availability availability = feature->IsAvailableToContext( | 80 Feature::Availability availability = feature->IsAvailableToContext( |
| 80 owner_extension, | 81 owner_extension, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 95 void ExtensionsGuestViewManagerDelegate::RegisterAdditionalGuestViewTypes() { | 96 void ExtensionsGuestViewManagerDelegate::RegisterAdditionalGuestViewTypes() { |
| 96 GuestViewManager* manager = GuestViewManager::FromBrowserContext(context_); | 97 GuestViewManager* manager = GuestViewManager::FromBrowserContext(context_); |
| 97 manager->RegisterGuestViewType<AppViewGuest>(); | 98 manager->RegisterGuestViewType<AppViewGuest>(); |
| 98 manager->RegisterGuestViewType<ExtensionOptionsGuest>(); | 99 manager->RegisterGuestViewType<ExtensionOptionsGuest>(); |
| 99 manager->RegisterGuestViewType<ExtensionViewGuest>(); | 100 manager->RegisterGuestViewType<ExtensionViewGuest>(); |
| 100 manager->RegisterGuestViewType<MimeHandlerViewGuest>(); | 101 manager->RegisterGuestViewType<MimeHandlerViewGuest>(); |
| 101 manager->RegisterGuestViewType<WebViewGuest>(); | 102 manager->RegisterGuestViewType<WebViewGuest>(); |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace extensions | 105 } // namespace extensions |
| OLD | NEW |