Index: chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc |
diff --git a/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc b/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc |
index e3cee470c763091df8f68d9ca31a91a862733a63..918aee34411a48ef02cc55e3cbea073430f8c130 100644 |
--- a/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc |
+++ b/chrome/browser/guest_view/chrome_guest_view_manager_delegate.cc |
@@ -4,38 +4,51 @@ |
#include "chrome/browser/guest_view/chrome_guest_view_manager_delegate.h" |
-#include "build/build_config.h" |
-#include "chrome/browser/task_management/web_contents_tags.h" |
+#include "components/framelet/browser/framelet_guest.h" |
-#if defined(OS_CHROMEOS) |
-#include "chrome/browser/chromeos/app_mode/app_session.h" |
-#include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
-#endif |
- |
-namespace extensions { |
+namespace chrome { |
-ChromeGuestViewManagerDelegate::ChromeGuestViewManagerDelegate( |
- content::BrowserContext* context) |
- : ExtensionsGuestViewManagerDelegate(context) { |
+// static |
+guest_view::GuestViewManagerDelegate* ChromeGuestViewManagerDelegate::Create( |
+ content::BrowserContext* browser_context) { |
+ return new ChromeGuestViewManagerDelegate(browser_context); |
} |
ChromeGuestViewManagerDelegate::~ChromeGuestViewManagerDelegate() { |
} |
-void ChromeGuestViewManagerDelegate::OnGuestAdded( |
- content::WebContents* guest_web_contents) const { |
- // Attaches the task-manager-specific tag for the GuestViews to its |
- // |guest_web_contents| so that their corresponding tasks show up in the task |
- // manager. |
- task_management::WebContentsTags::CreateForGuestContents(guest_web_contents); |
- |
-#if defined(OS_CHROMEOS) |
- // Notifies kiosk session about the added guest. |
- chromeos::AppSession* app_session = |
- chromeos::KioskAppManager::Get()->app_session(); |
- if (app_session) |
- app_session->OnGuestAdded(guest_web_contents); |
+void ChromeGuestViewManagerDelegate::DispatchEvent( |
+ const std::string& event_name, |
+ scoped_ptr<base::DictionaryValue> args, |
+ guest_view::GuestViewBase* guest, |
+ int instance_id) { |
+ // TODO(paulmeyer): Implement special case for framelet. |
+ GuestViewManagerDelegateBase::DispatchEvent(event_name, std::move(args), |
+ guest, instance_id); |
+} |
+ |
+bool ChromeGuestViewManagerDelegate::IsGuestAvailableToContext( |
+ guest_view::GuestViewBase* guest) { |
+ // Framelet is available in any context including the drive-by web. |
+ if (guest->IsViewType(framelet::FrameletGuest::Type)) |
+ return true; |
+ return GuestViewManagerDelegateBase::IsGuestAvailableToContext(guest); |
+} |
+ |
+void ChromeGuestViewManagerDelegate::RegisterAdditionalGuestViewTypes() { |
+ guest_view::GuestViewManager* manager = |
+ guest_view::GuestViewManager::FromBrowserContext(context_); |
+ manager->RegisterGuestViewType<framelet::FrameletGuest>(); |
+ GuestViewManagerDelegateBase::RegisterAdditionalGuestViewTypes(); |
+} |
+ |
+ChromeGuestViewManagerDelegate::ChromeGuestViewManagerDelegate( |
+ content::BrowserContext* context) |
+#if defined(ENABLE_EXTENSIONS) |
+ : GuestViewManagerDelegateBase(context) { |
+#else |
+ : GuestViewManagerDelegateBase(), context_(context) { |
#endif |
} |
-} // namespace extensions |
+} // namespace chrome |