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

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

Issue 21930006: <webview>: Allocate the view instance ID from the WebView shim (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with ToT Created 7 years, 4 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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 break; 824 break;
825 } 825 }
826 return; 826 return;
827 } 827 }
828 828
829 if (!extra_params) { 829 if (!extra_params) {
830 NOTREACHED(); 830 NOTREACHED();
831 return; 831 return;
832 } 832 }
833 std::string api_type; 833 std::string api_type;
834 extra_params->GetString(guestview::kAttributeApi, &api_type); 834 extra_params->GetString(guestview::kParameterApi, &api_type);
835 835
836 if (api_type == "adview") { 836 if (api_type == "adview") {
837 *guest_delegate = new AdViewGuest(guest_web_contents); 837 *guest_delegate = new AdViewGuest(guest_web_contents);
838 } else if (api_type == "webview") { 838 } else if (api_type == "webview") {
839 *guest_delegate = new WebViewGuest(guest_web_contents); 839 *guest_delegate = new WebViewGuest(guest_web_contents);
840 } else { 840 } else {
841 NOTREACHED(); 841 NOTREACHED();
842 } 842 }
843 } 843 }
844 844
845 void ChromeContentBrowserClient::GuestWebContentsAttached( 845 void ChromeContentBrowserClient::GuestWebContentsAttached(
846 WebContents* guest_web_contents, 846 WebContents* guest_web_contents,
847 WebContents* embedder_web_contents, 847 WebContents* embedder_web_contents,
848 int browser_plugin_instance_id,
849 const base::DictionaryValue& extra_params) { 848 const base::DictionaryValue& extra_params) {
850 Profile* profile = Profile::FromBrowserContext( 849 Profile* profile = Profile::FromBrowserContext(
851 embedder_web_contents->GetBrowserContext()); 850 embedder_web_contents->GetBrowserContext());
852 ExtensionService* service = 851 ExtensionService* service =
853 extensions::ExtensionSystem::Get(profile)->extension_service(); 852 extensions::ExtensionSystem::Get(profile)->extension_service();
854 if (!service) { 853 if (!service) {
855 NOTREACHED(); 854 NOTREACHED();
856 return; 855 return;
857 } 856 }
858 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL(); 857 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL();
859 const Extension* extension = 858 const Extension* extension =
860 service->extensions()->GetExtensionOrAppByURL(url); 859 service->extensions()->GetExtensionOrAppByURL(url);
861 if (!extension) { 860 if (!extension) {
862 // It's ok to return here, since we could be running a browser plugin 861 // It's ok to return here, since we could be running a browser plugin
863 // outside an extension, and don't need to attach a 862 // outside an extension, and don't need to attach a
864 // BrowserPluginGuestDelegate in that case; 863 // BrowserPluginGuestDelegate in that case;
865 // e.g. running with flag --enable-browser-plugin-for-all-view-types. 864 // e.g. running with flag --enable-browser-plugin-for-all-view-types.
866 return; 865 return;
867 } 866 }
868 867
869 GuestView* guest = GuestView::FromWebContents(guest_web_contents); 868 GuestView* guest = GuestView::FromWebContents(guest_web_contents);
870 if (!guest) { 869 if (!guest) {
871 NOTREACHED(); 870 NOTREACHED();
872 return; 871 return;
873 } 872 }
874 guest->Attach(embedder_web_contents, 873 guest->Attach(embedder_web_contents,
875 extension->id(), 874 extension->id(),
876 browser_plugin_instance_id,
877 extra_params); 875 extra_params);
878 } 876 }
879 877
880 void ChromeContentBrowserClient::RenderProcessHostCreated( 878 void ChromeContentBrowserClient::RenderProcessHostCreated(
881 content::RenderProcessHost* host) { 879 content::RenderProcessHost* host) {
882 int id = host->GetID(); 880 int id = host->GetID();
883 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 881 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
884 net::URLRequestContextGetter* context = 882 net::URLRequestContextGetter* context =
885 profile->GetRequestContextForRenderProcess(id); 883 profile->GetRequestContextForRenderProcess(id);
886 884
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
2554 #if defined(USE_NSS) 2552 #if defined(USE_NSS)
2555 crypto::CryptoModuleBlockingPasswordDelegate* 2553 crypto::CryptoModuleBlockingPasswordDelegate*
2556 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 2554 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
2557 const GURL& url) { 2555 const GURL& url) {
2558 return chrome::NewCryptoModuleBlockingDialogDelegate( 2556 return chrome::NewCryptoModuleBlockingDialogDelegate(
2559 chrome::kCryptoModulePasswordKeygen, url.host()); 2557 chrome::kCryptoModulePasswordKeygen, url.host());
2560 } 2558 }
2561 #endif 2559 #endif
2562 2560
2563 } // namespace chrome 2561 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/extensions/extension_renderer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698