| OLD | NEW | 
|     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 13 matching lines...) Expand all  Loading... | 
|    24 #include "chrome/browser/content_settings/host_content_settings_map.h" |    24 #include "chrome/browser/content_settings/host_content_settings_map.h" | 
|    25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |    25 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 
|    26 #include "chrome/browser/defaults.h" |    26 #include "chrome/browser/defaults.h" | 
|    27 #include "chrome/browser/download/download_util.h" |    27 #include "chrome/browser/download/download_util.h" | 
|    28 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |    28 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 
|    29 #include "chrome/browser/extensions/extension_host.h" |    29 #include "chrome/browser/extensions/extension_host.h" | 
|    30 #include "chrome/browser/extensions/extension_info_map.h" |    30 #include "chrome/browser/extensions/extension_info_map.h" | 
|    31 #include "chrome/browser/extensions/extension_message_handler.h" |    31 #include "chrome/browser/extensions/extension_message_handler.h" | 
|    32 #include "chrome/browser/extensions/extension_process_manager.h" |    32 #include "chrome/browser/extensions/extension_process_manager.h" | 
|    33 #include "chrome/browser/extensions/extension_service.h" |    33 #include "chrome/browser/extensions/extension_service.h" | 
 |    34 #include "chrome/browser/extensions/extension_system.h" | 
 |    35 #include "chrome/browser/extensions/extension_system_factory.h" | 
|    34 #include "chrome/browser/extensions/extension_web_ui.h" |    36 #include "chrome/browser/extensions/extension_web_ui.h" | 
|    35 #include "chrome/browser/extensions/extension_webkit_preferences.h" |    37 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 
|    36 #include "chrome/browser/geolocation/chrome_access_token_store.h" |    38 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 
|    37 #include "chrome/browser/google/google_util.h" |    39 #include "chrome/browser/google/google_util.h" | 
|    38 #include "chrome/browser/infobars/infobar_tab_helper.h" |    40 #include "chrome/browser/infobars/infobar_tab_helper.h" | 
|    39 #include "chrome/browser/media/media_internals.h" |    41 #include "chrome/browser/media/media_internals.h" | 
|    40 #include "chrome/browser/net/chrome_net_log.h" |    42 #include "chrome/browser/net/chrome_net_log.h" | 
|    41 #include "chrome/browser/notifications/desktop_notification_service.h" |    43 #include "chrome/browser/notifications/desktop_notification_service.h" | 
|    42 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |    44 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 
|    43 #include "chrome/browser/pepper_gtalk_message_filter.h" |    45 #include "chrome/browser/pepper_gtalk_message_filter.h" | 
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   614           site_instance->GetSite())); |   616           site_instance->GetSite())); | 
|   615   if (!extension) |   617   if (!extension) | 
|   616     return; |   618     return; | 
|   617  |   619  | 
|   618   service->process_map()->Insert(extension->id(), |   620   service->process_map()->Insert(extension->id(), | 
|   619                                  site_instance->GetProcess()->GetID(), |   621                                  site_instance->GetProcess()->GetID(), | 
|   620                                  site_instance->GetId()); |   622                                  site_instance->GetId()); | 
|   621   BrowserThread::PostTask( |   623   BrowserThread::PostTask( | 
|   622       BrowserThread::IO, FROM_HERE, |   624       BrowserThread::IO, FROM_HERE, | 
|   623       base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, |   625       base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, | 
|   624                  profile->GetExtensionInfoMap(), |   626                  ExtensionSystemFactory::GetForProfile(profile)->info_map(), | 
|   625                  extension->id(), |   627                  extension->id(), | 
|   626                  site_instance->GetProcess()->GetID(), |   628                  site_instance->GetProcess()->GetID(), | 
|   627                  site_instance->GetId())); |   629                  site_instance->GetId())); | 
|   628 } |   630 } | 
|   629  |   631  | 
|   630 void ChromeContentBrowserClient::SiteInstanceDeleting( |   632 void ChromeContentBrowserClient::SiteInstanceDeleting( | 
|   631     SiteInstance* site_instance) { |   633     SiteInstance* site_instance) { | 
|   632   if (!site_instance->HasProcess()) |   634   if (!site_instance->HasProcess()) | 
|   633     return; |   635     return; | 
|   634  |   636  | 
|   635   Profile* profile = Profile::FromBrowserContext( |   637   Profile* profile = Profile::FromBrowserContext( | 
|   636       site_instance->GetBrowserContext()); |   638       site_instance->GetBrowserContext()); | 
|   637   ExtensionService* service = profile->GetExtensionService(); |   639   ExtensionService* service = profile->GetExtensionService(); | 
|   638   if (!service) |   640   if (!service) | 
|   639     return; |   641     return; | 
|   640  |   642  | 
|   641   const Extension* extension = |   643   const Extension* extension = | 
|   642       service->extensions()->GetExtensionOrAppByURL( |   644       service->extensions()->GetExtensionOrAppByURL( | 
|   643           ExtensionURLInfo(site_instance->GetSite())); |   645           ExtensionURLInfo(site_instance->GetSite())); | 
|   644   if (!extension) |   646   if (!extension) | 
|   645     return; |   647     return; | 
|   646  |   648  | 
|   647   service->process_map()->Remove(extension->id(), |   649   service->process_map()->Remove(extension->id(), | 
|   648                                  site_instance->GetProcess()->GetID(), |   650                                  site_instance->GetProcess()->GetID(), | 
|   649                                  site_instance->GetId()); |   651                                  site_instance->GetId()); | 
|   650   BrowserThread::PostTask( |   652   BrowserThread::PostTask( | 
|   651       BrowserThread::IO, FROM_HERE, |   653       BrowserThread::IO, FROM_HERE, | 
|   652       base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, |   654       base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, | 
|   653                  profile->GetExtensionInfoMap(), |   655                  ExtensionSystemFactory::GetForProfile(profile)->info_map(), | 
|   654                  extension->id(), |   656                  extension->id(), | 
|   655                  site_instance->GetProcess()->GetID(), |   657                  site_instance->GetProcess()->GetID(), | 
|   656                  site_instance->GetId())); |   658                  site_instance->GetId())); | 
|   657 } |   659 } | 
|   658  |   660  | 
|   659 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( |   661 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( | 
|   660     const GURL& current_url, |   662     const GURL& current_url, | 
|   661     const GURL& new_url) { |   663     const GURL& new_url) { | 
|   662   if (current_url.is_empty()) { |   664   if (current_url.is_empty()) { | 
|   663     // Always choose a new process when navigating to extension URLs. The |   665     // Always choose a new process when navigating to extension URLs. The | 
| (...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1644 #if defined(USE_NSS) |  1646 #if defined(USE_NSS) | 
|  1645 crypto::CryptoModuleBlockingPasswordDelegate* |  1647 crypto::CryptoModuleBlockingPasswordDelegate* | 
|  1646     ChromeContentBrowserClient::GetCryptoPasswordDelegate( |  1648     ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 
|  1647         const GURL& url) { |  1649         const GURL& url) { | 
|  1648   return browser::NewCryptoModuleBlockingDialogDelegate( |  1650   return browser::NewCryptoModuleBlockingDialogDelegate( | 
|  1649       browser::kCryptoModulePasswordKeygen, url.host()); |  1651       browser::kCryptoModulePasswordKeygen, url.host()); | 
|  1650 } |  1652 } | 
|  1651 #endif |  1653 #endif | 
|  1652  |  1654  | 
|  1653 }  // namespace chrome |  1655 }  // namespace chrome | 
| OLD | NEW |