OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/character_encoding.h" | 10 #include "chrome/browser/character_encoding.h" |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
440 return; | 440 return; |
441 } | 441 } |
442 | 442 |
443 RenderProcessHost* process = rvh->process(); | 443 RenderProcessHost* process = rvh->process(); |
444 DesktopNotificationService* service = | 444 DesktopNotificationService* service = |
445 DesktopNotificationServiceFactory::GetForProfile(process->profile()); | 445 DesktopNotificationServiceFactory::GetForProfile(process->profile()); |
446 service->CancelDesktopNotification( | 446 service->CancelDesktopNotification( |
447 render_process_id, render_view_id, notification_id); | 447 render_process_id, render_view_id, notification_id); |
448 } | 448 } |
449 | 449 |
450 bool ChromeContentBrowserClient::CheckBackgroundPermission( | |
451 const GURL& source_url, const content::ResourceContext& context) { | |
452 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | |
453 ProfileIOData* io_data = | |
454 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); | |
455 | |
456 const Extension* extension = | |
457 io_data->GetExtensionInfoMap()->extensions().GetByURL(source_url); | |
458 return (extension && | |
459 extension->HasApiPermission(Extension::kBackgroundPermission)); | |
460 } | |
461 | |
462 std::string ChromeContentBrowserClient::GetWorkerProcessTitle( | |
463 const GURL& url, const content::ResourceContext& context) { | |
jam
2011/06/08 00:18:17
nit: add DCHECK(BrowserThread::CurrentlyOn(Browser
Matt Perry
2011/06/08 00:33:37
Done.
| |
464 // Check if it's an extension-created worker, in which case we want to use | |
465 // the name of the extension. | |
466 ProfileIOData* io_data = | |
467 reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL)); | |
468 const Extension* extension = | |
469 io_data->GetExtensionInfoMap()->extensions().GetByID(url.host()); | |
470 return extension ? extension->name() : std::string(); | |
471 } | |
472 | |
450 #if defined(OS_LINUX) | 473 #if defined(OS_LINUX) |
451 int ChromeContentBrowserClient::GetCrashSignalFD( | 474 int ChromeContentBrowserClient::GetCrashSignalFD( |
452 const std::string& process_type) { | 475 const std::string& process_type) { |
453 if (process_type == switches::kRendererProcess) | 476 if (process_type == switches::kRendererProcess) |
454 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 477 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
455 | 478 |
456 if (process_type == switches::kPluginProcess) | 479 if (process_type == switches::kPluginProcess) |
457 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 480 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
458 | 481 |
459 if (process_type == switches::kPpapiPluginProcess) | 482 if (process_type == switches::kPpapiPluginProcess) |
460 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 483 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
461 | 484 |
462 if (process_type == switches::kGpuProcess) | 485 if (process_type == switches::kGpuProcess) |
463 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 486 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
464 | 487 |
465 return -1; | 488 return -1; |
466 } | 489 } |
467 #endif | 490 #endif |
468 | 491 |
469 } // namespace chrome | 492 } // namespace chrome |
OLD | NEW |