| 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) {
|
|
|