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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 *guest_delegate = | 878 *guest_delegate = |
879 GuestViewBase::Create(guest_instance_id, | 879 GuestViewBase::Create(guest_instance_id, |
880 guest_web_contents, | 880 guest_web_contents, |
881 extension_id, | 881 extension_id, |
882 api_type); | 882 api_type); |
883 #else | 883 #else |
884 NOTREACHED(); | 884 NOTREACHED(); |
885 #endif // defined(ENABLE_EXTENSIONS) | 885 #endif // defined(ENABLE_EXTENSIONS) |
886 } | 886 } |
887 | 887 |
888 void ChromeContentBrowserClient::GuestWebContentsAttached( | |
889 WebContents* guest_web_contents, | |
890 WebContents* embedder_web_contents, | |
891 const base::DictionaryValue& extra_params) { | |
892 #if defined(ENABLE_EXTENSIONS) | |
893 GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents); | |
894 if (!guest) { | |
895 // It's ok to return here, since we could be running a browser plugin | |
896 // outside an extension, and don't need to attach a | |
897 // BrowserPluginGuestDelegate in that case; | |
898 // e.g. running with flag --enable-browser-plugin-for-all-view-types. | |
899 return; | |
900 } | |
901 guest->Attach(embedder_web_contents, extra_params); | |
902 #else | |
903 NOTREACHED(); | |
904 #endif // defined(ENABLE_EXTENSIONS) | |
905 } | |
906 | |
907 void ChromeContentBrowserClient::RenderProcessWillLaunch( | 888 void ChromeContentBrowserClient::RenderProcessWillLaunch( |
908 content::RenderProcessHost* host) { | 889 content::RenderProcessHost* host) { |
909 int id = host->GetID(); | 890 int id = host->GetID(); |
910 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 891 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
911 net::URLRequestContextGetter* context = | 892 net::URLRequestContextGetter* context = |
912 profile->GetRequestContextForRenderProcess(id); | 893 profile->GetRequestContextForRenderProcess(id); |
913 | 894 |
914 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); | 895 host->AddFilter(new ChromeRenderMessageFilter(id, profile)); |
915 #if defined(ENABLE_EXTENSIONS) | 896 #if defined(ENABLE_EXTENSIONS) |
916 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); | 897 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); |
(...skipping 1861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2778 switches::kDisableWebRtcEncryption, | 2759 switches::kDisableWebRtcEncryption, |
2779 }; | 2760 }; |
2780 to_command_line->CopySwitchesFrom(from_command_line, | 2761 to_command_line->CopySwitchesFrom(from_command_line, |
2781 kWebRtcDevSwitchNames, | 2762 kWebRtcDevSwitchNames, |
2782 arraysize(kWebRtcDevSwitchNames)); | 2763 arraysize(kWebRtcDevSwitchNames)); |
2783 } | 2764 } |
2784 } | 2765 } |
2785 #endif // defined(ENABLE_WEBRTC) | 2766 #endif // defined(ENABLE_WEBRTC) |
2786 | 2767 |
2787 } // namespace chrome | 2768 } // namespace chrome |
OLD | NEW |