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

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

Issue 272573005: <webview>: Move NewWindow API to chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@guestview_manager_rename
Patch Set: Addressed Istiaque's comments 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 CHECK(can_be_default || !partition_domain->empty()); 805 CHECK(can_be_default || !partition_domain->empty());
806 } 806 }
807 807
808 content::WebContentsViewDelegate* 808 content::WebContentsViewDelegate*
809 ChromeContentBrowserClient::GetWebContentsViewDelegate( 809 ChromeContentBrowserClient::GetWebContentsViewDelegate(
810 content::WebContents* web_contents) { 810 content::WebContents* web_contents) {
811 return chrome::CreateWebContentsViewDelegate(web_contents); 811 return chrome::CreateWebContentsViewDelegate(web_contents);
812 } 812 }
813 813
814 void ChromeContentBrowserClient::GuestWebContentsCreated( 814 void ChromeContentBrowserClient::GuestWebContentsCreated(
815 int guest_instance_id,
815 SiteInstance* guest_site_instance, 816 SiteInstance* guest_site_instance,
816 WebContents* guest_web_contents, 817 WebContents* guest_web_contents,
817 WebContents* opener_web_contents, 818 WebContents* opener_web_contents,
818 content::BrowserPluginGuestDelegate** guest_delegate, 819 content::BrowserPluginGuestDelegate** guest_delegate,
819 scoped_ptr<base::DictionaryValue> extra_params) { 820 scoped_ptr<base::DictionaryValue> extra_params) {
820 if (!guest_site_instance) { 821 if (!guest_site_instance) {
821 NOTREACHED(); 822 NOTREACHED();
822 return; 823 return;
823 } 824 }
824 GURL guest_site_url = guest_site_instance->GetSiteURL(); 825 GURL guest_site_url = guest_site_instance->GetSiteURL();
(...skipping 19 matching lines...) Expand all
844 845
845 if (opener_web_contents) { 846 if (opener_web_contents) {
846 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); 847 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents);
847 if (!guest) { 848 if (!guest) {
848 NOTREACHED(); 849 NOTREACHED();
849 return; 850 return;
850 } 851 }
851 852
852 // Create a new GuestViewBase of the same type as the opener. 853 // Create a new GuestViewBase of the same type as the opener.
853 *guest_delegate = GuestViewBase::Create( 854 *guest_delegate = GuestViewBase::Create(
855 guest_instance_id,
854 guest_web_contents, 856 guest_web_contents,
855 extension_id, 857 extension_id,
856 guest->GetViewType(), 858 guest->GetViewType());
857 guest->AsWeakPtr());
858 return; 859 return;
859 } 860 }
860 861
861 if (!extra_params) { 862 if (!extra_params) {
862 NOTREACHED(); 863 NOTREACHED();
863 return; 864 return;
864 } 865 }
865 std::string api_type; 866 std::string api_type;
866 extra_params->GetString(guestview::kParameterApi, &api_type); 867 extra_params->GetString(guestview::kParameterApi, &api_type);
867 868
868 if (api_type.empty()) 869 if (api_type.empty())
869 return; 870 return;
870 871
871 *guest_delegate = 872 *guest_delegate =
872 GuestViewBase::Create(guest_web_contents, 873 GuestViewBase::Create(guest_instance_id,
874 guest_web_contents,
873 extension_id, 875 extension_id,
874 api_type, 876 api_type);
875 base::WeakPtr<GuestViewBase>());
876 } 877 }
877 878
878 void ChromeContentBrowserClient::GuestWebContentsAttached( 879 void ChromeContentBrowserClient::GuestWebContentsAttached(
879 WebContents* guest_web_contents, 880 WebContents* guest_web_contents,
880 WebContents* embedder_web_contents, 881 WebContents* embedder_web_contents,
881 const base::DictionaryValue& extra_params) { 882 const base::DictionaryValue& extra_params) {
882 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); 883 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
883 if (!guest) { 884 if (!guest) {
884 // It's ok to return here, since we could be running a browser plugin 885 // It's ok to return here, since we could be running a browser plugin
885 // outside an extension, and don't need to attach a 886 // outside an extension, and don't need to attach a
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 switches::kDisableWebRtcEncryption, 2759 switches::kDisableWebRtcEncryption,
2759 }; 2760 };
2760 to_command_line->CopySwitchesFrom(from_command_line, 2761 to_command_line->CopySwitchesFrom(from_command_line,
2761 kWebRtcDevSwitchNames, 2762 kWebRtcDevSwitchNames,
2762 arraysize(kWebRtcDevSwitchNames)); 2763 arraysize(kWebRtcDevSwitchNames));
2763 } 2764 }
2764 } 2765 }
2765 #endif // defined(ENABLE_WEBRTC) 2766 #endif // defined(ENABLE_WEBRTC)
2766 2767
2767 } // namespace chrome 2768 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698