| 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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 CHECK(can_be_default || !partition_domain->empty()); | 804 CHECK(can_be_default || !partition_domain->empty()); |
| 805 } | 805 } |
| 806 | 806 |
| 807 content::WebContentsViewDelegate* | 807 content::WebContentsViewDelegate* |
| 808 ChromeContentBrowserClient::GetWebContentsViewDelegate( | 808 ChromeContentBrowserClient::GetWebContentsViewDelegate( |
| 809 content::WebContents* web_contents) { | 809 content::WebContents* web_contents) { |
| 810 return chrome::CreateWebContentsViewDelegate(web_contents); | 810 return chrome::CreateWebContentsViewDelegate(web_contents); |
| 811 } | 811 } |
| 812 | 812 |
| 813 void ChromeContentBrowserClient::GuestWebContentsCreated( | 813 void ChromeContentBrowserClient::GuestWebContentsCreated( |
| 814 int guest_instance_id, |
| 814 SiteInstance* guest_site_instance, | 815 SiteInstance* guest_site_instance, |
| 815 WebContents* guest_web_contents, | 816 WebContents* guest_web_contents, |
| 816 WebContents* opener_web_contents, | 817 WebContents* opener_web_contents, |
| 817 content::BrowserPluginGuestDelegate** guest_delegate, | 818 content::BrowserPluginGuestDelegate** guest_delegate, |
| 818 scoped_ptr<base::DictionaryValue> extra_params) { | 819 scoped_ptr<base::DictionaryValue> extra_params) { |
| 819 if (!guest_site_instance) { | 820 if (!guest_site_instance) { |
| 820 NOTREACHED(); | 821 NOTREACHED(); |
| 821 return; | 822 return; |
| 822 } | 823 } |
| 823 GURL guest_site_url = guest_site_instance->GetSiteURL(); | 824 GURL guest_site_url = guest_site_instance->GetSiteURL(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 843 | 844 |
| 844 if (opener_web_contents) { | 845 if (opener_web_contents) { |
| 845 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); | 846 GuestViewBase* guest = GuestViewBase::FromWebContents(opener_web_contents); |
| 846 if (!guest) { | 847 if (!guest) { |
| 847 NOTREACHED(); | 848 NOTREACHED(); |
| 848 return; | 849 return; |
| 849 } | 850 } |
| 850 | 851 |
| 851 // Create a new GuestViewBase of the same type as the opener. | 852 // Create a new GuestViewBase of the same type as the opener. |
| 852 *guest_delegate = GuestViewBase::Create( | 853 *guest_delegate = GuestViewBase::Create( |
| 854 guest_instance_id, |
| 853 guest_web_contents, | 855 guest_web_contents, |
| 854 extension_id, | 856 extension_id, |
| 855 guest->GetViewType(), | 857 guest->GetViewType()); |
| 856 guest->AsWeakPtr()); | |
| 857 return; | 858 return; |
| 858 } | 859 } |
| 859 | 860 |
| 860 if (!extra_params) { | 861 if (!extra_params) { |
| 861 NOTREACHED(); | 862 NOTREACHED(); |
| 862 return; | 863 return; |
| 863 } | 864 } |
| 864 std::string api_type; | 865 std::string api_type; |
| 865 extra_params->GetString(guestview::kParameterApi, &api_type); | 866 extra_params->GetString(guestview::kParameterApi, &api_type); |
| 866 | 867 |
| 867 if (api_type.empty()) | 868 if (api_type.empty()) |
| 868 return; | 869 return; |
| 869 | 870 |
| 870 *guest_delegate = | 871 *guest_delegate = |
| 871 GuestViewBase::Create(guest_web_contents, | 872 GuestViewBase::Create(guest_instance_id, |
| 873 guest_web_contents, |
| 872 extension_id, | 874 extension_id, |
| 873 api_type, | 875 api_type); |
| 874 base::WeakPtr<GuestViewBase>()); | |
| 875 } | 876 } |
| 876 | 877 |
| 877 void ChromeContentBrowserClient::GuestWebContentsAttached( | 878 void ChromeContentBrowserClient::GuestWebContentsAttached( |
| 878 WebContents* guest_web_contents, | 879 WebContents* guest_web_contents, |
| 879 WebContents* embedder_web_contents, | 880 WebContents* embedder_web_contents, |
| 880 const base::DictionaryValue& extra_params) { | 881 const base::DictionaryValue& extra_params) { |
| 881 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); | 882 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); |
| 882 if (!guest) { | 883 if (!guest) { |
| 883 // It's ok to return here, since we could be running a browser plugin | 884 // It's ok to return here, since we could be running a browser plugin |
| 884 // outside an extension, and don't need to attach a | 885 // outside an extension, and don't need to attach a |
| (...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2751 switches::kDisableWebRtcEncryption, | 2752 switches::kDisableWebRtcEncryption, |
| 2752 }; | 2753 }; |
| 2753 to_command_line->CopySwitchesFrom(from_command_line, | 2754 to_command_line->CopySwitchesFrom(from_command_line, |
| 2754 kWebRtcDevSwitchNames, | 2755 kWebRtcDevSwitchNames, |
| 2755 arraysize(kWebRtcDevSwitchNames)); | 2756 arraysize(kWebRtcDevSwitchNames)); |
| 2756 } | 2757 } |
| 2757 } | 2758 } |
| 2758 #endif // defined(ENABLE_WEBRTC) | 2759 #endif // defined(ENABLE_WEBRTC) |
| 2759 | 2760 |
| 2760 } // namespace chrome | 2761 } // namespace chrome |
| OLD | NEW |