OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "chrome/browser/extensions/extension_service.h" | 37 #include "chrome/browser/extensions/extension_service.h" |
38 #include "chrome/browser/extensions/extension_util.h" | 38 #include "chrome/browser/extensions/extension_util.h" |
39 #include "chrome/browser/extensions/extension_web_ui.h" | 39 #include "chrome/browser/extensions/extension_web_ui.h" |
40 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 40 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
41 #include "chrome/browser/extensions/suggest_permission_util.h" | 41 #include "chrome/browser/extensions/suggest_permission_util.h" |
42 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 42 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
43 #include "chrome/browser/google/google_util.h" | 43 #include "chrome/browser/google/google_util.h" |
44 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h" | 44 #include "chrome/browser/guest_view/ad_view/ad_view_guest.h" |
45 #include "chrome/browser/guest_view/guest_view_base.h" | 45 #include "chrome/browser/guest_view/guest_view_base.h" |
46 #include "chrome/browser/guest_view/guest_view_constants.h" | 46 #include "chrome/browser/guest_view/guest_view_constants.h" |
| 47 #include "chrome/browser/guest_view/guest_view_manager.h" |
47 #include "chrome/browser/guest_view/web_view/web_view_guest.h" | 48 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
48 #include "chrome/browser/media/cast_transport_host_filter.h" | 49 #include "chrome/browser/media/cast_transport_host_filter.h" |
49 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 50 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
50 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 51 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
51 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" | 52 #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" |
52 #include "chrome/browser/net/chrome_net_log.h" | 53 #include "chrome/browser/net/chrome_net_log.h" |
53 #include "chrome/browser/notifications/desktop_notification_service.h" | 54 #include "chrome/browser/notifications/desktop_notification_service.h" |
54 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 55 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
55 #include "chrome/browser/platform_util.h" | 56 #include "chrome/browser/platform_util.h" |
56 #include "chrome/browser/plugins/plugin_info_message_filter.h" | 57 #include "chrome/browser/plugins/plugin_info_message_filter.h" |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 | 842 |
842 if (opener_web_contents) { | 843 if (opener_web_contents) { |
843 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); | 844 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); |
844 if (!guest) { | 845 if (!guest) { |
845 NOTREACHED(); | 846 NOTREACHED(); |
846 return; | 847 return; |
847 } | 848 } |
848 | 849 |
849 // Create a new GuestViewBase of the same type as the opener. | 850 // Create a new GuestViewBase of the same type as the opener. |
850 *guest_delegate = GuestViewBase::Create( | 851 *guest_delegate = GuestViewBase::Create( |
851 guest_web_contents, extension_id, guest->GetViewType()); | 852 guest_web_contents, |
| 853 extension_id, |
| 854 guest->GetViewType(), |
| 855 guest->AsWeakPtr()); |
852 return; | 856 return; |
853 } | 857 } |
854 | 858 |
855 if (!extra_params) { | 859 if (!extra_params) { |
856 NOTREACHED(); | 860 NOTREACHED(); |
857 return; | 861 return; |
858 } | 862 } |
859 std::string api_type; | 863 std::string api_type; |
860 extra_params->GetString(guestview::kParameterApi, &api_type); | 864 extra_params->GetString(guestview::kParameterApi, &api_type); |
861 | 865 |
862 if (api_type.empty()) | 866 if (api_type.empty()) |
863 return; | 867 return; |
864 | 868 |
865 *guest_delegate = | 869 *guest_delegate = |
866 GuestViewBase::Create(guest_web_contents, extension_id, api_type); | 870 GuestViewBase::Create(guest_web_contents, |
| 871 extension_id, |
| 872 api_type, |
| 873 base::WeakPtr<GuestViewBase>()); |
867 } | 874 } |
868 | 875 |
869 void ChromeContentBrowserClient::GuestWebContentsAttached( | 876 void ChromeContentBrowserClient::GuestWebContentsAttached( |
870 WebContents* guest_web_contents, | 877 WebContents* guest_web_contents, |
871 WebContents* embedder_web_contents, | 878 WebContents* embedder_web_contents, |
872 const base::DictionaryValue& extra_params) { | 879 const base::DictionaryValue& extra_params) { |
873 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); | 880 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); |
874 if (!guest) { | 881 if (!guest) { |
875 // It's ok to return here, since we could be running a browser plugin | 882 // It's ok to return here, since we could be running a browser plugin |
876 // outside an extension, and don't need to attach a | 883 // outside an extension, and don't need to attach a |
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 switches::kDisableWebRtcEncryption, | 2679 switches::kDisableWebRtcEncryption, |
2673 }; | 2680 }; |
2674 to_command_line->CopySwitchesFrom(from_command_line, | 2681 to_command_line->CopySwitchesFrom(from_command_line, |
2675 kWebRtcDevSwitchNames, | 2682 kWebRtcDevSwitchNames, |
2676 arraysize(kWebRtcDevSwitchNames)); | 2683 arraysize(kWebRtcDevSwitchNames)); |
2677 } | 2684 } |
2678 } | 2685 } |
2679 #endif // defined(ENABLE_WEBRTC) | 2686 #endif // defined(ENABLE_WEBRTC) |
2680 | 2687 |
2681 } // namespace chrome | 2688 } // namespace chrome |
OLD | NEW |