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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 | 847 |
847 if (opener_web_contents) { | 848 if (opener_web_contents) { |
848 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); | 849 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); |
849 if (!guest) { | 850 if (!guest) { |
850 NOTREACHED(); | 851 NOTREACHED(); |
851 return; | 852 return; |
852 } | 853 } |
853 | 854 |
854 // Create a new GuestViewBase of the same type as the opener. | 855 // Create a new GuestViewBase of the same type as the opener. |
855 *guest_delegate = GuestViewBase::Create( | 856 *guest_delegate = GuestViewBase::Create( |
856 guest_web_contents, extension_id, guest->GetViewType()); | 857 guest_web_contents, |
| 858 extension_id, |
| 859 guest->GetViewType(), |
| 860 guest->AsWeakPtr()); |
857 return; | 861 return; |
858 } | 862 } |
859 | 863 |
860 if (!extra_params) { | 864 if (!extra_params) { |
861 NOTREACHED(); | 865 NOTREACHED(); |
862 return; | 866 return; |
863 } | 867 } |
864 std::string api_type; | 868 std::string api_type; |
865 extra_params->GetString(guestview::kParameterApi, &api_type); | 869 extra_params->GetString(guestview::kParameterApi, &api_type); |
866 | 870 |
867 if (api_type.empty()) | 871 if (api_type.empty()) |
868 return; | 872 return; |
869 | 873 |
870 *guest_delegate = | 874 *guest_delegate = |
871 GuestViewBase::Create(guest_web_contents, extension_id, api_type); | 875 GuestViewBase::Create(guest_web_contents, |
| 876 extension_id, |
| 877 api_type, |
| 878 base::WeakPtr<GuestViewBase>()); |
872 } | 879 } |
873 | 880 |
874 void ChromeContentBrowserClient::GuestWebContentsAttached( | 881 void ChromeContentBrowserClient::GuestWebContentsAttached( |
875 WebContents* guest_web_contents, | 882 WebContents* guest_web_contents, |
876 WebContents* embedder_web_contents, | 883 WebContents* embedder_web_contents, |
877 const base::DictionaryValue& extra_params) { | 884 const base::DictionaryValue& extra_params) { |
878 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); | 885 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); |
879 if (!guest) { | 886 if (!guest) { |
880 // It's ok to return here, since we could be running a browser plugin | 887 // It's ok to return here, since we could be running a browser plugin |
881 // outside an extension, and don't need to attach a | 888 // outside an extension, and don't need to attach a |
(...skipping 1790 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 |