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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 7135003: Remove last extension dependencies from content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 13dd1eccdd0aa25a66caaf902e660d83af2f2fe8..ff159f353e3f0b2834704317647842d654fe4e86 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -447,6 +447,36 @@ void ChromeContentBrowserClient::CancelDesktopNotification(
render_process_id, render_view_id, notification_id);
}
+bool ChromeContentBrowserClient::CanCreateWindow(
+ const GURL& source_url,
+ WindowContainerType container_type,
+ const content::ResourceContext& context) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ // If the opener is trying to create a background window but doesn't have
+ // the appropriate permission, fail the attempt.
+ if (container_type == WINDOW_CONTAINER_TYPE_BACKGROUND) {
+ ProfileIOData* io_data =
+ reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
+ const Extension* extension =
+ io_data->GetExtensionInfoMap()->extensions().GetByURL(source_url);
+ return (extension &&
+ extension->HasApiPermission(Extension::kBackgroundPermission));
+ }
+ return true;
+}
+
+std::string ChromeContentBrowserClient::GetWorkerProcessTitle(
+ const GURL& url, const content::ResourceContext& context) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+ // Check if it's an extension-created worker, in which case we want to use
+ // the name of the extension.
+ ProfileIOData* io_data =
+ reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
+ const Extension* extension =
+ io_data->GetExtensionInfoMap()->extensions().GetByID(url.host());
+ return extension ? extension->name() : std::string();
+}
+
#if defined(OS_LINUX)
int ChromeContentBrowserClient::GetCrashSignalFD(
const std::string& process_type) {
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698