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

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: Cleanup and fix tests 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); 844 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents);
845 if (!guest) { 845 if (!guest) {
846 NOTREACHED(); 846 NOTREACHED();
847 return; 847 return;
848 } 848 }
849 849
850 // Create a new GuestViewBase of the same type as the opener. 850 // Create a new GuestViewBase of the same type as the opener.
851 *guest_delegate = GuestViewBase::Create( 851 *guest_delegate = GuestViewBase::Create(
852 guest_web_contents, 852 guest_web_contents,
853 extension_id, 853 extension_id,
854 guest->GetViewType(), 854 guest->GetViewType());
855 guest->AsWeakPtr());
856 return; 855 return;
857 } 856 }
858 857
859 if (!extra_params) { 858 if (!extra_params) {
860 NOTREACHED(); 859 NOTREACHED();
861 return; 860 return;
862 } 861 }
863 std::string api_type; 862 std::string api_type;
864 extra_params->GetString(guestview::kParameterApi, &api_type); 863 extra_params->GetString(guestview::kParameterApi, &api_type);
865 864
866 if (api_type.empty()) 865 if (api_type.empty())
867 return; 866 return;
868 867
869 *guest_delegate = 868 *guest_delegate =
870 GuestViewBase::Create(guest_web_contents, 869 GuestViewBase::Create(guest_web_contents,
871 extension_id, 870 extension_id,
872 api_type, 871 api_type);
873 base::WeakPtr<GuestViewBase>());
874 } 872 }
875 873
876 void ChromeContentBrowserClient::GuestWebContentsAttached( 874 void ChromeContentBrowserClient::GuestWebContentsAttached(
877 WebContents* guest_web_contents, 875 WebContents* guest_web_contents,
878 WebContents* embedder_web_contents, 876 WebContents* embedder_web_contents,
879 const base::DictionaryValue& extra_params) { 877 const base::DictionaryValue& extra_params) {
880 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); 878 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
881 if (!guest) { 879 if (!guest) {
882 // It's ok to return here, since we could be running a browser plugin 880 // It's ok to return here, since we could be running a browser plugin
883 // outside an extension, and don't need to attach a 881 // outside an extension, and don't need to attach a
(...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2715 switches::kDisableWebRtcEncryption, 2713 switches::kDisableWebRtcEncryption,
2716 }; 2714 };
2717 to_command_line->CopySwitchesFrom(from_command_line, 2715 to_command_line->CopySwitchesFrom(from_command_line,
2718 kWebRtcDevSwitchNames, 2716 kWebRtcDevSwitchNames,
2719 arraysize(kWebRtcDevSwitchNames)); 2717 arraysize(kWebRtcDevSwitchNames));
2720 } 2718 }
2721 } 2719 }
2722 #endif // defined(ENABLE_WEBRTC) 2720 #endif // defined(ENABLE_WEBRTC)
2723 2721
2724 } // namespace chrome 2722 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698