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

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

Issue 11968054: <webview>: Implement ExecuteScript (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 7 years, 11 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 | Annotate | Revision Log
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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 582
583 SiteInstance* site_instance = render_view_host->GetSiteInstance(); 583 SiteInstance* site_instance = render_view_host->GetSiteInstance();
584 Profile* profile = Profile::FromBrowserContext( 584 Profile* profile = Profile::FromBrowserContext(
585 site_instance->GetBrowserContext()); 585 site_instance->GetBrowserContext());
586 586
587 new ChromeRenderViewHostObserver(render_view_host, 587 new ChromeRenderViewHostObserver(render_view_host,
588 profile->GetNetworkPredictor()); 588 profile->GetNetworkPredictor());
589 new extensions::MessageHandler(render_view_host); 589 new extensions::MessageHandler(render_view_host);
590 } 590 }
591 591
592 void ChromeContentBrowserClient::GuestWebContentsCreated(
593 WebContents* guest_web_contents, WebContents* embedder_web_contents) {
594 Profile* profile = Profile::FromBrowserContext(
595 embedder_web_contents->GetBrowserContext());
596 ExtensionService* service =
597 extensions::ExtensionSystem::Get(profile)->extension_service();
598 if (!service)
599 return;
600 const GURL& url = embedder_web_contents->GetSiteInstance()->GetSiteURL();
601 const Extension* extension = service->extensions()->
602 GetExtensionOrAppByURL(ExtensionURLInfo(url));
603 if (!extension)
604 return;
605 std::vector<ExtensionMsg_Loaded_Params> extensions;
606 extensions.push_back(ExtensionMsg_Loaded_Params(extension));
607 guest_web_contents->Send(new ExtensionMsg_Loaded(extensions));
608 }
609
592 void ChromeContentBrowserClient::RenderProcessHostCreated( 610 void ChromeContentBrowserClient::RenderProcessHostCreated(
593 content::RenderProcessHost* host) { 611 content::RenderProcessHost* host) {
594 int id = host->GetID(); 612 int id = host->GetID();
595 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 613 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
596 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( 614 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter(
597 id, profile, profile->GetRequestContextForRenderProcess(id))); 615 id, profile, profile->GetRequestContextForRenderProcess(id)));
598 #if defined(ENABLE_PLUGINS) 616 #if defined(ENABLE_PLUGINS)
599 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); 617 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile));
600 #endif 618 #endif
601 #if defined(ENABLE_PRINTING) 619 #if defined(ENABLE_PRINTING)
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 io_thread_application_locale_ = locale; 1920 io_thread_application_locale_ = locale;
1903 } 1921 }
1904 1922
1905 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( 1923 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread(
1906 const std::string& locale) { 1924 const std::string& locale) {
1907 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 1925 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
1908 io_thread_application_locale_ = locale; 1926 io_thread_application_locale_ = locale;
1909 } 1927 }
1910 1928
1911 } // namespace chrome 1929 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698