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

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: 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/guestview/adview/adview_guest.h" 44 #include "chrome/browser/guestview/adview/adview_guest.h"
45 #include "chrome/browser/guestview/guestview.h" 45 #include "chrome/browser/guestview/guestview.h"
46 #include "chrome/browser/guestview/guestview_constants.h" 46 #include "chrome/browser/guestview/guestview_constants.h"
47 #include "chrome/browser/guestview/guestview_manager.h"
47 #include "chrome/browser/guestview/webview/webview_guest.h" 48 #include "chrome/browser/guestview/webview/webview_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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 // safe to continue. 809 // safe to continue.
809 CHECK(can_be_default || !partition_domain->empty()); 810 CHECK(can_be_default || !partition_domain->empty());
810 } 811 }
811 812
812 content::WebContentsViewDelegate* 813 content::WebContentsViewDelegate*
813 ChromeContentBrowserClient::GetWebContentsViewDelegate( 814 ChromeContentBrowserClient::GetWebContentsViewDelegate(
814 content::WebContents* web_contents) { 815 content::WebContents* web_contents) {
815 return chrome::CreateWebContentsViewDelegate(web_contents); 816 return chrome::CreateWebContentsViewDelegate(web_contents);
816 } 817 }
817 818
819 content::BrowserPluginGuestManagerDelegate*
820 ChromeContentBrowserClient::GetGuestManagerDelegate(
lazyboy 2014/04/30 08:40:15 nit: think you don't need spaces here.
821 content::BrowserContext* context) {
822 return new GuestViewManager(context);
823 }
824
818 void ChromeContentBrowserClient::GuestWebContentsCreated( 825 void ChromeContentBrowserClient::GuestWebContentsCreated(
819 SiteInstance* guest_site_instance, 826 SiteInstance* guest_site_instance,
820 WebContents* guest_web_contents, 827 WebContents* guest_web_contents,
821 WebContents* opener_web_contents, 828 WebContents* opener_web_contents,
822 content::BrowserPluginGuestDelegate** guest_delegate, 829 content::BrowserPluginGuestDelegate** guest_delegate,
823 scoped_ptr<base::DictionaryValue> extra_params) { 830 scoped_ptr<base::DictionaryValue> extra_params) {
824 if (!guest_site_instance) { 831 if (!guest_site_instance) {
825 NOTREACHED(); 832 NOTREACHED();
826 return; 833 return;
827 } 834 }
(...skipping 21 matching lines...) Expand all
849 GuestView* guest = GuestView::FromWebContents(opener_web_contents); 856 GuestView* guest = GuestView::FromWebContents(opener_web_contents);
850 if (!guest) { 857 if (!guest) {
851 NOTREACHED(); 858 NOTREACHED();
852 return; 859 return;
853 } 860 }
854 861
855 // Create a new GuestView of the same type as the opener. 862 // Create a new GuestView of the same type as the opener.
856 *guest_delegate = 863 *guest_delegate =
857 GuestView::Create(guest_web_contents, 864 GuestView::Create(guest_web_contents,
858 extension_id, 865 extension_id,
859 guest->GetViewType()); 866 guest->GetViewType(),
867 guest->AsWeakPtr());
860 return; 868 return;
861 } 869 }
862 870
863 if (!extra_params) { 871 if (!extra_params) {
864 NOTREACHED(); 872 NOTREACHED();
865 return; 873 return;
866 } 874 }
867 std::string api_type; 875 std::string api_type;
868 extra_params->GetString(guestview::kParameterApi, &api_type); 876 extra_params->GetString(guestview::kParameterApi, &api_type);
869 877
870 if (api_type.empty()) 878 if (api_type.empty())
871 return; 879 return;
872 880
873 *guest_delegate = 881 *guest_delegate =
874 GuestView::Create(guest_web_contents, 882 GuestView::Create(guest_web_contents,
875 extension_id, 883 extension_id,
876 GuestView::GetViewTypeFromString(api_type)); 884 GuestView::GetViewTypeFromString(api_type),
885 base::WeakPtr<GuestView>());
877 } 886 }
878 887
879 void ChromeContentBrowserClient::GuestWebContentsAttached( 888 void ChromeContentBrowserClient::GuestWebContentsAttached(
880 WebContents* guest_web_contents, 889 WebContents* guest_web_contents,
881 WebContents* embedder_web_contents, 890 WebContents* embedder_web_contents,
882 const base::DictionaryValue& extra_params) { 891 const base::DictionaryValue& extra_params) {
883 892
884 GuestView* guest = GuestView::FromWebContents(guest_web_contents); 893 GuestView* guest = GuestView::FromWebContents(guest_web_contents);
885 if (!guest) { 894 if (!guest) {
886 // It's ok to return here, since we could be running a browser plugin 895 // It's ok to return here, since we could be running a browser plugin
(...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 switches::kDisableWebRtcEncryption, 2686 switches::kDisableWebRtcEncryption,
2678 }; 2687 };
2679 to_command_line->CopySwitchesFrom(from_command_line, 2688 to_command_line->CopySwitchesFrom(from_command_line,
2680 kWebRtcDevSwitchNames, 2689 kWebRtcDevSwitchNames,
2681 arraysize(kWebRtcDevSwitchNames)); 2690 arraysize(kWebRtcDevSwitchNames));
2682 } 2691 }
2683 } 2692 }
2684 #endif // defined(ENABLE_WEBRTC) 2693 #endif // defined(ENABLE_WEBRTC)
2685 2694
2686 } // namespace chrome 2695 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698