| 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 "chrome/browser/guest_view/guest_view_base.h" | 5 #include "extensions/browser/guest_view/guest_view_base.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/guest_view/guest_view_manager.h" | |
| 10 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 11 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 12 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 13 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 14 #include "content/public/common/url_constants.h" | 13 #include "content/public/common/url_constants.h" |
| 15 #include "extensions/browser/api/extensions_api_client.h" | 14 #include "extensions/browser/api/extensions_api_client.h" |
| 16 #include "extensions/browser/event_router.h" | 15 #include "extensions/browser/event_router.h" |
| 17 #include "extensions/browser/extension_registry.h" | 16 #include "extensions/browser/extension_registry.h" |
| 18 #include "extensions/browser/guest_view/guest_view_constants.h" | 17 #include "extensions/browser/guest_view/guest_view_constants.h" |
| 18 #include "extensions/browser/guest_view/guest_view_manager.h" |
| 19 #include "extensions/browser/process_map.h" | 19 #include "extensions/browser/process_map.h" |
| 20 #include "extensions/common/features/feature.h" | 20 #include "extensions/common/features/feature.h" |
| 21 #include "extensions/common/features/feature_provider.h" | 21 #include "extensions/common/features/feature_provider.h" |
| 22 #include "third_party/WebKit/public/web/WebInputEvent.h" | 22 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 23 | 23 |
| 24 using content::WebContents; | 24 using content::WebContents; |
| 25 | 25 |
| 26 namespace extensions { |
| 27 |
| 26 namespace { | 28 namespace { |
| 27 | 29 |
| 28 typedef std::map<std::string, GuestViewBase::GuestCreationCallback> | 30 typedef std::map<std::string, GuestViewBase::GuestCreationCallback> |
| 29 GuestViewCreationMap; | 31 GuestViewCreationMap; |
| 30 static base::LazyInstance<GuestViewCreationMap> guest_view_registry = | 32 static base::LazyInstance<GuestViewCreationMap> guest_view_registry = |
| 31 LAZY_INSTANCE_INITIALIZER; | 33 LAZY_INSTANCE_INITIALIZER; |
| 32 | 34 |
| 33 typedef std::map<WebContents*, GuestViewBase*> WebContentsGuestViewMap; | 35 typedef std::map<WebContents*, GuestViewBase*> WebContentsGuestViewMap; |
| 34 static base::LazyInstance<WebContentsGuestViewMap> webcontents_guestview_map = | 36 static base::LazyInstance<WebContentsGuestViewMap> webcontents_guestview_map = |
| 35 LAZY_INSTANCE_INITIALIZER; | 37 LAZY_INSTANCE_INITIALIZER; |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 InitWithWebContents(embedder_extension_id, | 443 InitWithWebContents(embedder_extension_id, |
| 442 embedder_render_process_id, | 444 embedder_render_process_id, |
| 443 guest_web_contents); | 445 guest_web_contents); |
| 444 callback.Run(guest_web_contents); | 446 callback.Run(guest_web_contents); |
| 445 } | 447 } |
| 446 | 448 |
| 447 // static | 449 // static |
| 448 void GuestViewBase::RegisterGuestViewTypes() { | 450 void GuestViewBase::RegisterGuestViewTypes() { |
| 449 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); | 451 extensions::ExtensionsAPIClient::Get()->RegisterGuestViewTypes(); |
| 450 } | 452 } |
| 453 |
| 454 } // namespace extensions |
| OLD | NEW |