| 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 14 matching lines...) Expand all Loading... |
| 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" | 34 #include "chrome/browser/extensions/extension_system.h" |
| 35 #include "chrome/browser/extensions/extension_system_factory.h" | |
| 36 #include "chrome/browser/extensions/extension_web_ui.h" | 35 #include "chrome/browser/extensions/extension_web_ui.h" |
| 37 #include "chrome/browser/extensions/extension_webkit_preferences.h" | 36 #include "chrome/browser/extensions/extension_webkit_preferences.h" |
| 38 #include "chrome/browser/geolocation/chrome_access_token_store.h" | 37 #include "chrome/browser/geolocation/chrome_access_token_store.h" |
| 39 #include "chrome/browser/google/google_util.h" | 38 #include "chrome/browser/google/google_util.h" |
| 40 #include "chrome/browser/infobars/infobar_tab_helper.h" | 39 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 41 #include "chrome/browser/media/media_internals.h" | 40 #include "chrome/browser/media/media_internals.h" |
| 42 #include "chrome/browser/net/chrome_net_log.h" | 41 #include "chrome/browser/net/chrome_net_log.h" |
| 43 #include "chrome/browser/notifications/desktop_notification_service.h" | 42 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 44 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 43 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 45 #include "chrome/browser/pepper_gtalk_message_filter.h" | 44 #include "chrome/browser/pepper_gtalk_message_filter.h" |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 site_instance->GetSite())); | 626 site_instance->GetSite())); |
| 628 if (!extension) | 627 if (!extension) |
| 629 return; | 628 return; |
| 630 | 629 |
| 631 service->process_map()->Insert(extension->id(), | 630 service->process_map()->Insert(extension->id(), |
| 632 site_instance->GetProcess()->GetID(), | 631 site_instance->GetProcess()->GetID(), |
| 633 site_instance->GetId()); | 632 site_instance->GetId()); |
| 634 BrowserThread::PostTask( | 633 BrowserThread::PostTask( |
| 635 BrowserThread::IO, FROM_HERE, | 634 BrowserThread::IO, FROM_HERE, |
| 636 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, | 635 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, |
| 637 ExtensionSystemFactory::GetForProfile(profile)->info_map(), | 636 ExtensionSystem::Get(profile)->info_map(), |
| 638 extension->id(), | 637 extension->id(), |
| 639 site_instance->GetProcess()->GetID(), | 638 site_instance->GetProcess()->GetID(), |
| 640 site_instance->GetId())); | 639 site_instance->GetId())); |
| 641 } | 640 } |
| 642 | 641 |
| 643 void ChromeContentBrowserClient::SiteInstanceDeleting( | 642 void ChromeContentBrowserClient::SiteInstanceDeleting( |
| 644 SiteInstance* site_instance) { | 643 SiteInstance* site_instance) { |
| 645 if (!site_instance->HasProcess()) | 644 if (!site_instance->HasProcess()) |
| 646 return; | 645 return; |
| 647 | 646 |
| 648 Profile* profile = Profile::FromBrowserContext( | 647 Profile* profile = Profile::FromBrowserContext( |
| 649 site_instance->GetBrowserContext()); | 648 site_instance->GetBrowserContext()); |
| 650 ExtensionService* service = profile->GetExtensionService(); | 649 ExtensionService* service = profile->GetExtensionService(); |
| 651 if (!service) | 650 if (!service) |
| 652 return; | 651 return; |
| 653 | 652 |
| 654 const Extension* extension = | 653 const Extension* extension = |
| 655 service->extensions()->GetExtensionOrAppByURL( | 654 service->extensions()->GetExtensionOrAppByURL( |
| 656 ExtensionURLInfo(site_instance->GetSite())); | 655 ExtensionURLInfo(site_instance->GetSite())); |
| 657 if (!extension) | 656 if (!extension) |
| 658 return; | 657 return; |
| 659 | 658 |
| 660 service->process_map()->Remove(extension->id(), | 659 service->process_map()->Remove(extension->id(), |
| 661 site_instance->GetProcess()->GetID(), | 660 site_instance->GetProcess()->GetID(), |
| 662 site_instance->GetId()); | 661 site_instance->GetId()); |
| 663 BrowserThread::PostTask( | 662 BrowserThread::PostTask( |
| 664 BrowserThread::IO, FROM_HERE, | 663 BrowserThread::IO, FROM_HERE, |
| 665 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, | 664 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, |
| 666 ExtensionSystemFactory::GetForProfile(profile)->info_map(), | 665 ExtensionSystem::Get(profile)->info_map(), |
| 667 extension->id(), | 666 extension->id(), |
| 668 site_instance->GetProcess()->GetID(), | 667 site_instance->GetProcess()->GetID(), |
| 669 site_instance->GetId())); | 668 site_instance->GetId())); |
| 670 } | 669 } |
| 671 | 670 |
| 672 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( | 671 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( |
| 673 const GURL& current_url, | 672 const GURL& current_url, |
| 674 const GURL& new_url) { | 673 const GURL& new_url) { |
| 675 if (current_url.is_empty()) { | 674 if (current_url.is_empty()) { |
| 676 // Always choose a new process when navigating to extension URLs. The | 675 // Always choose a new process when navigating to extension URLs. The |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 #if defined(USE_NSS) | 1646 #if defined(USE_NSS) |
| 1648 crypto::CryptoModuleBlockingPasswordDelegate* | 1647 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1649 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1648 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1650 const GURL& url) { | 1649 const GURL& url) { |
| 1651 return browser::NewCryptoModuleBlockingDialogDelegate( | 1650 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1652 browser::kCryptoModulePasswordKeygen, url.host()); | 1651 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1653 } | 1652 } |
| 1654 #endif | 1653 #endif |
| 1655 | 1654 |
| 1656 } // namespace chrome | 1655 } // namespace chrome |
| OLD | NEW |