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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/bookmarks/bookmark_model.h" | 23 #include "chrome/browser/bookmarks/bookmark_model.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/browsing_data_remover.h" | 25 #include "chrome/browser/browsing_data_remover.h" |
26 #include "chrome/browser/chrome_plugin_service_filter.h" | 26 #include "chrome/browser/chrome_plugin_service_filter.h" |
27 #include "chrome/browser/content_settings/cookie_settings.h" | 27 #include "chrome/browser/content_settings/cookie_settings.h" |
28 #include "chrome/browser/content_settings/host_content_settings_map.h" | 28 #include "chrome/browser/content_settings/host_content_settings_map.h" |
29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 29 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
30 #include "chrome/browser/defaults.h" | 30 #include "chrome/browser/defaults.h" |
31 #include "chrome/browser/download/download_service.h" | 31 #include "chrome/browser/download/download_service.h" |
32 #include "chrome/browser/download/download_service_factory.h" | 32 #include "chrome/browser/download/download_service_factory.h" |
| 33 #include "chrome/browser/extensions/component_loader.h" |
| 34 #include "chrome/browser/extensions/extension_devtools_manager.h" |
| 35 #include "chrome/browser/extensions/extension_error_reporter.h" |
33 #include "chrome/browser/extensions/extension_event_router.h" | 36 #include "chrome/browser/extensions/extension_event_router.h" |
| 37 #include "chrome/browser/extensions/extension_info_map.h" |
| 38 #include "chrome/browser/extensions/extension_message_service.h" |
| 39 #include "chrome/browser/extensions/extension_navigation_observer.h" |
34 #include "chrome/browser/extensions/extension_pref_store.h" | 40 #include "chrome/browser/extensions/extension_pref_store.h" |
35 #include "chrome/browser/extensions/extension_pref_value_map.h" | |
36 #include "chrome/browser/extensions/extension_process_manager.h" | 41 #include "chrome/browser/extensions/extension_process_manager.h" |
37 #include "chrome/browser/extensions/extension_service.h" | 42 #include "chrome/browser/extensions/extension_service.h" |
38 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 43 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
39 #include "chrome/browser/extensions/extension_system.h" | 44 #include "chrome/browser/extensions/unpacked_installer.h" |
40 #include "chrome/browser/extensions/extension_system_factory.h" | |
41 #include "chrome/browser/extensions/user_script_master.h" | 45 #include "chrome/browser/extensions/user_script_master.h" |
42 #include "chrome/browser/favicon/favicon_service.h" | 46 #include "chrome/browser/favicon/favicon_service.h" |
43 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 47 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
44 #include "chrome/browser/history/history.h" | 48 #include "chrome/browser/history/history.h" |
45 #include "chrome/browser/history/shortcuts_backend.h" | 49 #include "chrome/browser/history/shortcuts_backend.h" |
46 #include "chrome/browser/history/top_sites.h" | 50 #include "chrome/browser/history/top_sites.h" |
47 #include "chrome/browser/instant/instant_controller.h" | 51 #include "chrome/browser/instant/instant_controller.h" |
48 #include "chrome/browser/metrics/metrics_service.h" | 52 #include "chrome/browser/metrics/metrics_service.h" |
49 #include "chrome/browser/net/chrome_url_request_context.h" | 53 #include "chrome/browser/net/chrome_url_request_context.h" |
50 #include "chrome/browser/net/net_pref_observer.h" | 54 #include "chrome/browser/net/net_pref_observer.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 PasswordStoreX::RegisterUserPrefs(prefs); | 225 PasswordStoreX::RegisterUserPrefs(prefs); |
222 #endif | 226 #endif |
223 } | 227 } |
224 | 228 |
225 ProfileImpl::ProfileImpl(const FilePath& path, | 229 ProfileImpl::ProfileImpl(const FilePath& path, |
226 Profile::Delegate* delegate) | 230 Profile::Delegate* delegate) |
227 : path_(path), | 231 : path_(path), |
228 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_( | 232 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_( |
229 new VisitedLinkEventListener(this))), | 233 new VisitedLinkEventListener(this))), |
230 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 234 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
| 235 extension_devtools_manager_(NULL), |
231 host_content_settings_map_(NULL), | 236 host_content_settings_map_(NULL), |
232 history_service_created_(false), | 237 history_service_created_(false), |
233 favicon_service_created_(false), | 238 favicon_service_created_(false), |
234 created_web_data_service_(false), | 239 created_web_data_service_(false), |
235 created_password_store_(false), | 240 created_password_store_(false), |
236 start_time_(Time::Now()), | 241 start_time_(Time::Now()), |
237 #if defined(OS_WIN) | 242 #if defined(OS_WIN) |
238 checked_instant_promo_(false), | 243 checked_instant_promo_(false), |
239 #endif | 244 #endif |
240 delegate_(delegate), | 245 delegate_(delegate), |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 host, &zoom_level); | 423 host, &zoom_level); |
419 DCHECK(success); | 424 DCHECK(success); |
420 host_zoom_map->SetZoomLevel(host, zoom_level); | 425 host_zoom_map->SetZoomLevel(host, zoom_level); |
421 } | 426 } |
422 } | 427 } |
423 | 428 |
424 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 429 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
425 content::Source<HostZoomMap>(host_zoom_map)); | 430 content::Source<HostZoomMap>(host_zoom_map)); |
426 } | 431 } |
427 | 432 |
| 433 void ProfileImpl::InitExtensions(bool extensions_enabled) { |
| 434 if (user_script_master_ || extension_service_.get()) |
| 435 return; // Already initialized. |
| 436 |
| 437 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 438 if (command_line->HasSwitch( |
| 439 switches::kEnableExtensionTimelineApi)) { |
| 440 extension_devtools_manager_ = new ExtensionDevToolsManager(this); |
| 441 } |
| 442 |
| 443 // The ExtensionInfoMap needs to be created before the |
| 444 // ExtensionProcessManager. |
| 445 extension_info_map_ = new ExtensionInfoMap(); |
| 446 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
| 447 extension_event_router_.reset(new ExtensionEventRouter(this)); |
| 448 extension_message_service_ = new ExtensionMessageService(this); |
| 449 extension_navigation_observer_.reset(new ExtensionNavigationObserver(this)); |
| 450 |
| 451 ExtensionErrorReporter::Init(true); // allow noisy errors. |
| 452 |
| 453 user_script_master_ = new UserScriptMaster(this); |
| 454 |
| 455 bool autoupdate_enabled = true; |
| 456 #if defined(OS_CHROMEOS) |
| 457 if (!extensions_enabled) |
| 458 autoupdate_enabled = false; |
| 459 else |
| 460 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); |
| 461 #endif |
| 462 extension_service_.reset(new ExtensionService( |
| 463 this, |
| 464 CommandLine::ForCurrentProcess(), |
| 465 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
| 466 extension_prefs_.get(), |
| 467 autoupdate_enabled, |
| 468 extensions_enabled)); |
| 469 |
| 470 extension_service_->component_loader()->AddDefaultComponentExtensions(); |
| 471 if (command_line->HasSwitch(switches::kLoadComponentExtension)) { |
| 472 CommandLine::StringType path_list = command_line->GetSwitchValueNative( |
| 473 switches::kLoadComponentExtension); |
| 474 StringTokenizerT<CommandLine::StringType, |
| 475 CommandLine::StringType::const_iterator> t(path_list, |
| 476 FILE_PATH_LITERAL(",")); |
| 477 while (t.GetNext()) { |
| 478 // Load the component extension manifest synchronously. |
| 479 // Blocking the UI thread is acceptable here since |
| 480 // this flag designated for developers. |
| 481 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 482 extension_service_->component_loader()->AddOrReplace( |
| 483 FilePath(t.token())); |
| 484 } |
| 485 } |
| 486 extension_service_->Init(); |
| 487 |
| 488 if (extensions_enabled) { |
| 489 // Load any extensions specified with --load-extension. |
| 490 // TODO(yoz): Seems like this should move into ExtensionService::Init. |
| 491 if (command_line->HasSwitch(switches::kLoadExtension)) { |
| 492 CommandLine::StringType path_list = command_line->GetSwitchValueNative( |
| 493 switches::kLoadExtension); |
| 494 StringTokenizerT<CommandLine::StringType, |
| 495 CommandLine::StringType::const_iterator> t(path_list, |
| 496 FILE_PATH_LITERAL(",")); |
| 497 scoped_refptr<extensions::UnpackedInstaller> installer = |
| 498 extensions::UnpackedInstaller::Create(extension_service_.get()); |
| 499 while (t.GetNext()) { |
| 500 installer->LoadFromCommandLine(FilePath(t.token())); |
| 501 } |
| 502 } |
| 503 } |
| 504 |
| 505 // Make the chrome://extension-icon/ resource available. |
| 506 GetChromeURLDataManager()->AddDataSource(new ExtensionIconSource(this)); |
| 507 |
| 508 // Initialize extension event routers. Note that on Chrome OS, this will |
| 509 // not succeed if the user has not logged in yet, in which case the |
| 510 // event routers are initialized in LoginUtilsImpl::CompleteLogin instead. |
| 511 // The InitEventRouters call used to be in BrowserMain, because when bookmark |
| 512 // import happened on first run, the bookmark bar was not being correctly |
| 513 // initialized (see issue 40144). Now that bookmarks aren't imported and |
| 514 // the event routers need to be initialized for every profile individually, |
| 515 // initialize them with the extension service. |
| 516 // If this profile is being created as part of the import process, never |
| 517 // initialize the event routers. If import is going to run in a separate |
| 518 // process (the profile itself is on the main process), wait for import to |
| 519 // finish before initializing the routers. |
| 520 if (!command_line->HasSwitch(switches::kImport) && |
| 521 !command_line->HasSwitch(switches::kImportFromFile)) { |
| 522 if (g_browser_process->profile_manager()->will_import()) { |
| 523 extension_service_->InitEventRoutersAfterImport(); |
| 524 } else { |
| 525 extension_service_->InitEventRouters(); |
| 526 } |
| 527 } |
| 528 } |
| 529 |
428 void ProfileImpl::InitPromoResources() { | 530 void ProfileImpl::InitPromoResources() { |
429 if (promo_resource_service_) | 531 if (promo_resource_service_) |
430 return; | 532 return; |
431 | 533 |
432 promo_resource_service_ = new PromoResourceService(this); | 534 promo_resource_service_ = new PromoResourceService(this); |
433 promo_resource_service_->StartAfterDelay(); | 535 promo_resource_service_->StartAfterDelay(); |
434 } | 536 } |
435 | 537 |
436 void ProfileImpl::InitRegisteredProtocolHandlers() { | 538 void ProfileImpl::InitRegisteredProtocolHandlers() { |
437 if (protocol_handler_registry_) | 539 if (protocol_handler_registry_) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 // HistoryService will join with HistoryService's backend thread so that | 620 // HistoryService will join with HistoryService's backend thread so that |
519 // by the time the destructor has finished we're sure it will no longer call | 621 // by the time the destructor has finished we're sure it will no longer call |
520 // into the BookmarkModel. | 622 // into the BookmarkModel. |
521 history_service_ = NULL; | 623 history_service_ = NULL; |
522 bookmark_bar_model_.reset(); | 624 bookmark_bar_model_.reset(); |
523 | 625 |
524 // FaviconService depends on HistoryServce so make sure we delete | 626 // FaviconService depends on HistoryServce so make sure we delete |
525 // HistoryService first. | 627 // HistoryService first. |
526 favicon_service_.reset(); | 628 favicon_service_.reset(); |
527 | 629 |
| 630 if (extension_message_service_) |
| 631 extension_message_service_->DestroyingProfile(); |
| 632 |
528 if (pref_proxy_config_tracker_.get()) | 633 if (pref_proxy_config_tracker_.get()) |
529 pref_proxy_config_tracker_->DetachFromPrefService(); | 634 pref_proxy_config_tracker_->DetachFromPrefService(); |
530 | 635 |
531 if (protocol_handler_registry_) | 636 if (protocol_handler_registry_) |
532 protocol_handler_registry_->Finalize(); | 637 protocol_handler_registry_->Finalize(); |
533 | 638 |
534 if (host_content_settings_map_) | 639 if (host_content_settings_map_) |
535 host_content_settings_map_->ShutdownOnUIThread(); | 640 host_content_settings_map_->ShutdownOnUIThread(); |
536 | 641 |
537 // This causes the Preferences file to be written to disk. | 642 // This causes the Preferences file to be written to disk. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 new VisitedLinkMaster(visited_link_event_listener_.get(), this)); | 687 new VisitedLinkMaster(visited_link_event_listener_.get(), this)); |
583 if (!visited_links->Init()) | 688 if (!visited_links->Init()) |
584 return NULL; | 689 return NULL; |
585 visited_link_master_.swap(visited_links); | 690 visited_link_master_.swap(visited_links); |
586 } | 691 } |
587 | 692 |
588 return visited_link_master_.get(); | 693 return visited_link_master_.get(); |
589 } | 694 } |
590 | 695 |
591 ExtensionService* ProfileImpl::GetExtensionService() { | 696 ExtensionService* ProfileImpl::GetExtensionService() { |
592 return ExtensionSystemFactory::GetForProfile(this)->extension_service(); | 697 return extension_service_.get(); |
593 } | 698 } |
594 | 699 |
595 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { | 700 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { |
596 return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); | 701 return user_script_master_.get(); |
| 702 } |
| 703 |
| 704 ExtensionDevToolsManager* ProfileImpl::GetExtensionDevToolsManager() { |
| 705 return extension_devtools_manager_.get(); |
597 } | 706 } |
598 | 707 |
599 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { | 708 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { |
600 return ExtensionSystemFactory::GetForProfile(this)->process_manager(); | 709 return extension_process_manager_.get(); |
| 710 } |
| 711 |
| 712 ExtensionMessageService* ProfileImpl::GetExtensionMessageService() { |
| 713 return extension_message_service_.get(); |
601 } | 714 } |
602 | 715 |
603 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { | 716 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { |
604 return ExtensionSystemFactory::GetForProfile(this)->event_router(); | 717 return extension_event_router_.get(); |
605 } | 718 } |
606 | 719 |
607 ExtensionSpecialStoragePolicy* | 720 ExtensionSpecialStoragePolicy* |
608 ProfileImpl::GetExtensionSpecialStoragePolicy() { | 721 ProfileImpl::GetExtensionSpecialStoragePolicy() { |
609 if (!extension_special_storage_policy_.get()) { | 722 if (!extension_special_storage_policy_.get()) { |
610 extension_special_storage_policy_ = new ExtensionSpecialStoragePolicy( | 723 extension_special_storage_policy_ = new ExtensionSpecialStoragePolicy( |
611 CookieSettings::Factory::GetForProfile(this)); | 724 CookieSettings::Factory::GetForProfile(this)); |
612 } | 725 } |
613 return extension_special_storage_policy_.get(); | 726 return extension_special_storage_policy_.get(); |
614 } | 727 } |
(...skipping 15 matching lines...) Expand all Loading... |
630 g_browser_process->local_state()); | 743 g_browser_process->local_state()); |
631 } | 744 } |
632 | 745 |
633 // The last session exited cleanly if there is no pref for | 746 // The last session exited cleanly if there is no pref for |
634 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. | 747 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. |
635 last_session_exited_cleanly_ = | 748 last_session_exited_cleanly_ = |
636 prefs_->GetBoolean(prefs::kSessionExitedCleanly); | 749 prefs_->GetBoolean(prefs::kSessionExitedCleanly); |
637 // Mark the session as open. | 750 // Mark the session as open. |
638 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); | 751 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); |
639 | 752 |
| 753 bool extensions_disabled = |
| 754 prefs_->GetBoolean(prefs::kDisableExtensions) || |
| 755 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); |
| 756 |
640 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 757 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
641 | 758 |
| 759 // Ensure that preferences set by extensions are restored in the profile |
| 760 // as early as possible. The constructor takes care of that. |
| 761 extension_prefs_.reset(new ExtensionPrefs( |
| 762 prefs_.get(), |
| 763 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
| 764 GetExtensionPrefValueMap())); |
| 765 extension_prefs_->Init(extensions_disabled); |
| 766 |
642 DCHECK(!net_pref_observer_.get()); | 767 DCHECK(!net_pref_observer_.get()); |
643 net_pref_observer_.reset(new NetPrefObserver( | 768 net_pref_observer_.reset(new NetPrefObserver( |
644 prefs_.get(), | 769 prefs_.get(), |
645 prerender::PrerenderManagerFactory::GetForProfile(this), | 770 prerender::PrerenderManagerFactory::GetForProfile(this), |
646 predictor_)); | 771 predictor_)); |
647 | 772 |
648 DoFinalInit(); | 773 DoFinalInit(); |
649 } | 774 } |
650 | 775 |
651 PrefService* ProfileImpl::GetPrefs() { | 776 PrefService* ProfileImpl::GetPrefs() { |
(...skipping 24 matching lines...) Expand all Loading... |
676 // Even when Chromium is started in OTR mode, a normal profile is always | 801 // Even when Chromium is started in OTR mode, a normal profile is always |
677 // created first. | 802 // created first. |
678 if (!default_request_context_) | 803 if (!default_request_context_) |
679 default_request_context_ = request_context; | 804 default_request_context_ = request_context; |
680 | 805 |
681 return request_context; | 806 return request_context; |
682 } | 807 } |
683 | 808 |
684 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 809 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
685 int renderer_child_id) { | 810 int renderer_child_id) { |
686 ExtensionService* extension_service = | 811 if (extension_service_.get()) { |
687 ExtensionSystemFactory::GetForProfile(this)->extension_service(); | 812 const Extension* installed_app = extension_service_-> |
688 if (extension_service) { | |
689 const Extension* installed_app = extension_service-> | |
690 GetInstalledAppForRenderer(renderer_child_id); | 813 GetInstalledAppForRenderer(renderer_child_id); |
691 if (installed_app != NULL && installed_app->is_storage_isolated() && | 814 if (installed_app != NULL && installed_app->is_storage_isolated() && |
692 installed_app->HasAPIPermission( | 815 installed_app->HasAPIPermission( |
693 ExtensionAPIPermission::kExperimental)) { | 816 ExtensionAPIPermission::kExperimental)) { |
694 return GetRequestContextForIsolatedApp(installed_app->id()); | 817 return GetRequestContextForIsolatedApp(installed_app->id()); |
695 } | 818 } |
696 } | 819 } |
697 return GetRequestContext(); | 820 return GetRequestContext(); |
698 } | 821 } |
699 | 822 |
(...skipping 15 matching lines...) Expand all Loading... |
715 | 838 |
716 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 839 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
717 return io_data_.GetExtensionsRequestContextGetter(); | 840 return io_data_.GetExtensionsRequestContextGetter(); |
718 } | 841 } |
719 | 842 |
720 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( | 843 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( |
721 const std::string& app_id) { | 844 const std::string& app_id) { |
722 return io_data_.GetIsolatedAppRequestContextGetter(app_id); | 845 return io_data_.GetIsolatedAppRequestContextGetter(app_id); |
723 } | 846 } |
724 | 847 |
| 848 void ProfileImpl::RegisterExtensionWithRequestContexts( |
| 849 const Extension* extension) { |
| 850 base::Time install_time; |
| 851 if (extension->location() != Extension::COMPONENT) { |
| 852 install_time = GetExtensionService()->extension_prefs()-> |
| 853 GetInstallTime(extension->id()); |
| 854 } |
| 855 bool incognito_enabled = |
| 856 GetExtensionService()->IsIncognitoEnabled(extension->id()); |
| 857 BrowserThread::PostTask( |
| 858 BrowserThread::IO, FROM_HERE, |
| 859 base::Bind(&ExtensionInfoMap::AddExtension, extension_info_map_.get(), |
| 860 make_scoped_refptr(extension), install_time, |
| 861 incognito_enabled)); |
| 862 } |
| 863 |
| 864 void ProfileImpl::UnregisterExtensionWithRequestContexts( |
| 865 const std::string& extension_id, |
| 866 const extension_misc::UnloadedExtensionReason reason) { |
| 867 BrowserThread::PostTask( |
| 868 BrowserThread::IO, FROM_HERE, |
| 869 base::Bind(&ExtensionInfoMap::RemoveExtension, extension_info_map_.get(), |
| 870 extension_id, reason)); |
| 871 } |
| 872 |
725 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 873 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
726 return ssl_config_service_manager_->Get(); | 874 return ssl_config_service_manager_->Get(); |
727 } | 875 } |
728 | 876 |
729 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 877 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
730 if (!host_content_settings_map_.get()) { | 878 if (!host_content_settings_map_.get()) { |
731 host_content_settings_map_ = new HostContentSettingsMap( | 879 host_content_settings_map_ = new HostContentSettingsMap( |
732 GetPrefs(), GetExtensionService(), false); | 880 GetPrefs(), GetExtensionService(), false); |
733 } | 881 } |
734 return host_content_settings_map_.get(); | 882 return host_content_settings_map_.get(); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 SessionServiceFactory::GetForProfile(this); | 1242 SessionServiceFactory::GetForProfile(this); |
1095 } | 1243 } |
1096 | 1244 |
1097 TokenService* ProfileImpl::GetTokenService() { | 1245 TokenService* ProfileImpl::GetTokenService() { |
1098 if (!token_service_.get()) { | 1246 if (!token_service_.get()) { |
1099 token_service_.reset(new TokenService()); | 1247 token_service_.reset(new TokenService()); |
1100 } | 1248 } |
1101 return token_service_.get(); | 1249 return token_service_.get(); |
1102 } | 1250 } |
1103 | 1251 |
| 1252 ExtensionInfoMap* ProfileImpl::GetExtensionInfoMap() { |
| 1253 return extension_info_map_.get(); |
| 1254 } |
| 1255 |
1104 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { | 1256 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { |
1105 if (!chrome_url_data_manager_.get()) | 1257 if (!chrome_url_data_manager_.get()) |
1106 chrome_url_data_manager_.reset(new ChromeURLDataManager( | 1258 chrome_url_data_manager_.reset(new ChromeURLDataManager( |
1107 io_data_.GetChromeURLDataManagerBackendGetter())); | 1259 io_data_.GetChromeURLDataManagerBackendGetter())); |
1108 return chrome_url_data_manager_.get(); | 1260 return chrome_url_data_manager_.get(); |
1109 } | 1261 } |
1110 | 1262 |
1111 PromoCounter* ProfileImpl::GetInstantPromoCounter() { | 1263 PromoCounter* ProfileImpl::GetInstantPromoCounter() { |
1112 #if defined(OS_WIN) | 1264 #if defined(OS_WIN) |
1113 // TODO: enable this when we're ready to turn on the promo. | 1265 // TODO: enable this when we're ready to turn on the promo. |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1309 FilePath* cache_path, | 1461 FilePath* cache_path, |
1310 int* max_size) { | 1462 int* max_size) { |
1311 DCHECK(cache_path); | 1463 DCHECK(cache_path); |
1312 DCHECK(max_size); | 1464 DCHECK(max_size); |
1313 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1465 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1314 if (!path.empty()) | 1466 if (!path.empty()) |
1315 *cache_path = path; | 1467 *cache_path = path; |
1316 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1468 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1317 prefs_->GetInteger(prefs::kDiskCacheSize); | 1469 prefs_->GetInteger(prefs::kDiskCacheSize); |
1318 } | 1470 } |
OLD | NEW |