Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1478)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 258373002: Towards moving guest management to chrome: Introduce GuestViewManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 // safe to continue. 807 // safe to continue.
807 CHECK(can_be_default || !partition_domain->empty()); 808 CHECK(can_be_default || !partition_domain->empty());
808 } 809 }
809 810
810 content::WebContentsViewDelegate* 811 content::WebContentsViewDelegate*
811 ChromeContentBrowserClient::GetWebContentsViewDelegate( 812 ChromeContentBrowserClient::GetWebContentsViewDelegate(
812 content::WebContents* web_contents) { 813 content::WebContents* web_contents) {
813 return chrome::CreateWebContentsViewDelegate(web_contents); 814 return chrome::CreateWebContentsViewDelegate(web_contents);
814 } 815 }
815 816
817 content::BrowserPluginGuestManagerDelegate*
818 ChromeContentBrowserClient::GetGuestManagerDelegate(
819 content::BrowserContext* context) {
820 return GuestViewManager::FromBrowserContext(context);
821 }
822
816 void ChromeContentBrowserClient::GuestWebContentsCreated( 823 void ChromeContentBrowserClient::GuestWebContentsCreated(
817 SiteInstance* guest_site_instance, 824 SiteInstance* guest_site_instance,
818 WebContents* guest_web_contents, 825 WebContents* guest_web_contents,
819 WebContents* opener_web_contents, 826 WebContents* opener_web_contents,
820 content::BrowserPluginGuestDelegate** guest_delegate, 827 content::BrowserPluginGuestDelegate** guest_delegate,
821 scoped_ptr<base::DictionaryValue> extra_params) { 828 scoped_ptr<base::DictionaryValue> extra_params) {
822 if (!guest_site_instance) { 829 if (!guest_site_instance) {
823 NOTREACHED(); 830 NOTREACHED();
824 return; 831 return;
825 } 832 }
(...skipping 20 matching lines...) Expand all
846 853
847 if (opener_web_contents) { 854 if (opener_web_contents) {
848 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); 855 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents);
849 if (!guest) { 856 if (!guest) {
850 NOTREACHED(); 857 NOTREACHED();
851 return; 858 return;
852 } 859 }
853 860
854 // Create a new GuestViewBase of the same type as the opener. 861 // Create a new GuestViewBase of the same type as the opener.
855 *guest_delegate = GuestViewBase::Create( 862 *guest_delegate = GuestViewBase::Create(
856 guest_web_contents, extension_id, guest->GetViewType()); 863 guest_web_contents,
864 extension_id,
865 guest->GetViewType(),
866 guest->AsWeakPtr());
857 return; 867 return;
858 } 868 }
859 869
860 if (!extra_params) { 870 if (!extra_params) {
861 NOTREACHED(); 871 NOTREACHED();
862 return; 872 return;
863 } 873 }
864 std::string api_type; 874 std::string api_type;
865 extra_params->GetString(guestview::kParameterApi, &api_type); 875 extra_params->GetString(guestview::kParameterApi, &api_type);
866 876
867 if (api_type.empty()) 877 if (api_type.empty())
868 return; 878 return;
869 879
870 *guest_delegate = 880 *guest_delegate =
871 GuestViewBase::Create(guest_web_contents, extension_id, api_type); 881 GuestViewBase::Create(guest_web_contents,
882 extension_id,
883 api_type,
884 base::WeakPtr<GuestViewBase>());
872 } 885 }
873 886
874 void ChromeContentBrowserClient::GuestWebContentsAttached( 887 void ChromeContentBrowserClient::GuestWebContentsAttached(
875 WebContents* guest_web_contents, 888 WebContents* guest_web_contents,
876 WebContents* embedder_web_contents, 889 WebContents* embedder_web_contents,
877 const base::DictionaryValue& extra_params) { 890 const base::DictionaryValue& extra_params) {
878 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); 891 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
879 if (!guest) { 892 if (!guest) {
880 // It's ok to return here, since we could be running a browser plugin 893 // 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 894 // outside an extension, and don't need to attach a
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
2672 switches::kDisableWebRtcEncryption, 2685 switches::kDisableWebRtcEncryption,
2673 }; 2686 };
2674 to_command_line->CopySwitchesFrom(from_command_line, 2687 to_command_line->CopySwitchesFrom(from_command_line,
2675 kWebRtcDevSwitchNames, 2688 kWebRtcDevSwitchNames,
2676 arraysize(kWebRtcDevSwitchNames)); 2689 arraysize(kWebRtcDevSwitchNames));
2677 } 2690 }
2678 } 2691 }
2679 #endif // defined(ENABLE_WEBRTC) 2692 #endif // defined(ENABLE_WEBRTC)
2680 2693
2681 } // namespace chrome 2694 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698