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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 9583036: Revert 124817 - Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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/webrequest/webrequest_api.h" 28 #include "chrome/browser/extensions/api/webrequest/webrequest_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_process_manager.h" 31 #include "chrome/browser/extensions/extension_process_manager.h"
32 #include "chrome/browser/extensions/extension_message_handler.h" 32 #include "chrome/browser/extensions/extension_message_handler.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"
36 #include "chrome/browser/extensions/extension_web_ui.h" 34 #include "chrome/browser/extensions/extension_web_ui.h"
37 #include "chrome/browser/extensions/extension_webkit_preferences.h" 35 #include "chrome/browser/extensions/extension_webkit_preferences.h"
38 #include "chrome/browser/geolocation/chrome_access_token_store.h" 36 #include "chrome/browser/geolocation/chrome_access_token_store.h"
39 #include "chrome/browser/google/google_util.h" 37 #include "chrome/browser/google/google_util.h"
40 #include "chrome/browser/infobars/infobar_tab_helper.h" 38 #include "chrome/browser/infobars/infobar_tab_helper.h"
41 #include "chrome/browser/net/chrome_net_log.h" 39 #include "chrome/browser/net/chrome_net_log.h"
42 #include "chrome/browser/notifications/desktop_notification_service.h" 40 #include "chrome/browser/notifications/desktop_notification_service.h"
43 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 41 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
44 #include "chrome/browser/platform_util.h" 42 #include "chrome/browser/platform_util.h"
45 #include "chrome/browser/prefs/pref_service.h" 43 #include "chrome/browser/prefs/pref_service.h"
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 site_instance->GetSite())); 588 site_instance->GetSite()));
591 if (!extension) 589 if (!extension)
592 return; 590 return;
593 591
594 service->process_map()->Insert(extension->id(), 592 service->process_map()->Insert(extension->id(),
595 site_instance->GetProcess()->GetID(), 593 site_instance->GetProcess()->GetID(),
596 site_instance->GetId()); 594 site_instance->GetId());
597 BrowserThread::PostTask( 595 BrowserThread::PostTask(
598 BrowserThread::IO, FROM_HERE, 596 BrowserThread::IO, FROM_HERE,
599 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, 597 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess,
600 ExtensionSystemFactory::GetForProfile(profile)->info_map(), 598 profile->GetExtensionInfoMap(),
601 extension->id(), 599 extension->id(),
602 site_instance->GetProcess()->GetID(), 600 site_instance->GetProcess()->GetID(),
603 site_instance->GetId())); 601 site_instance->GetId()));
604 } 602 }
605 603
606 void ChromeContentBrowserClient::SiteInstanceDeleting( 604 void ChromeContentBrowserClient::SiteInstanceDeleting(
607 SiteInstance* site_instance) { 605 SiteInstance* site_instance) {
608 if (!site_instance->HasProcess()) 606 if (!site_instance->HasProcess())
609 return; 607 return;
610 608
611 Profile* profile = Profile::FromBrowserContext( 609 Profile* profile = Profile::FromBrowserContext(
612 site_instance->GetBrowserContext()); 610 site_instance->GetBrowserContext());
613 ExtensionService* service = profile->GetExtensionService(); 611 ExtensionService* service = profile->GetExtensionService();
614 if (!service) 612 if (!service)
615 return; 613 return;
616 614
617 const Extension* extension = 615 const Extension* extension =
618 service->extensions()->GetExtensionOrAppByURL( 616 service->extensions()->GetExtensionOrAppByURL(
619 ExtensionURLInfo(site_instance->GetSite())); 617 ExtensionURLInfo(site_instance->GetSite()));
620 if (!extension) 618 if (!extension)
621 return; 619 return;
622 620
623 service->process_map()->Remove(extension->id(), 621 service->process_map()->Remove(extension->id(),
624 site_instance->GetProcess()->GetID(), 622 site_instance->GetProcess()->GetID(),
625 site_instance->GetId()); 623 site_instance->GetId());
626 BrowserThread::PostTask( 624 BrowserThread::PostTask(
627 BrowserThread::IO, FROM_HERE, 625 BrowserThread::IO, FROM_HERE,
628 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, 626 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess,
629 ExtensionSystemFactory::GetForProfile(profile)->info_map(), 627 profile->GetExtensionInfoMap(),
630 extension->id(), 628 extension->id(),
631 site_instance->GetProcess()->GetID(), 629 site_instance->GetProcess()->GetID(),
632 site_instance->GetId())); 630 site_instance->GetId()));
633 } 631 }
634 632
635 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( 633 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation(
636 const GURL& current_url, 634 const GURL& current_url,
637 const GURL& new_url) { 635 const GURL& new_url) {
638 if (current_url.is_empty()) { 636 if (current_url.is_empty()) {
639 // Always choose a new process when navigating to extension URLs. The 637 // Always choose a new process when navigating to extension URLs. The
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 #if defined(USE_NSS) 1587 #if defined(USE_NSS)
1590 crypto::CryptoModuleBlockingPasswordDelegate* 1588 crypto::CryptoModuleBlockingPasswordDelegate*
1591 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 1589 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
1592 const GURL& url) { 1590 const GURL& url) {
1593 return browser::NewCryptoModuleBlockingDialogDelegate( 1591 return browser::NewCryptoModuleBlockingDialogDelegate(
1594 browser::kCryptoModulePasswordKeygen, url.host()); 1592 browser::kCryptoModulePasswordKeygen, url.host());
1595 } 1593 }
1596 #endif 1594 #endif
1597 1595
1598 } // namespace chrome 1596 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/extensions/extension_devtools_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698