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" | |
36 #include "chrome/browser/extensions/extension_event_router.h" | 33 #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" | |
40 #include "chrome/browser/extensions/extension_pref_store.h" | 34 #include "chrome/browser/extensions/extension_pref_store.h" |
| 35 #include "chrome/browser/extensions/extension_pref_value_map.h" |
41 #include "chrome/browser/extensions/extension_process_manager.h" | 36 #include "chrome/browser/extensions/extension_process_manager.h" |
42 #include "chrome/browser/extensions/extension_service.h" | 37 #include "chrome/browser/extensions/extension_service.h" |
43 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 38 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
44 #include "chrome/browser/extensions/unpacked_installer.h" | 39 #include "chrome/browser/extensions/extension_system.h" |
| 40 #include "chrome/browser/extensions/extension_system_factory.h" |
45 #include "chrome/browser/extensions/user_script_master.h" | 41 #include "chrome/browser/extensions/user_script_master.h" |
46 #include "chrome/browser/favicon/favicon_service.h" | 42 #include "chrome/browser/favicon/favicon_service.h" |
47 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 43 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
48 #include "chrome/browser/history/history.h" | 44 #include "chrome/browser/history/history.h" |
49 #include "chrome/browser/history/shortcuts_backend.h" | 45 #include "chrome/browser/history/shortcuts_backend.h" |
50 #include "chrome/browser/history/top_sites.h" | 46 #include "chrome/browser/history/top_sites.h" |
51 #include "chrome/browser/instant/instant_controller.h" | 47 #include "chrome/browser/instant/instant_controller.h" |
52 #include "chrome/browser/metrics/metrics_service.h" | 48 #include "chrome/browser/metrics/metrics_service.h" |
53 #include "chrome/browser/net/chrome_url_request_context.h" | 49 #include "chrome/browser/net/chrome_url_request_context.h" |
54 #include "chrome/browser/net/net_pref_observer.h" | 50 #include "chrome/browser/net/net_pref_observer.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 PasswordStoreX::RegisterUserPrefs(prefs); | 221 PasswordStoreX::RegisterUserPrefs(prefs); |
226 #endif | 222 #endif |
227 } | 223 } |
228 | 224 |
229 ProfileImpl::ProfileImpl(const FilePath& path, | 225 ProfileImpl::ProfileImpl(const FilePath& path, |
230 Profile::Delegate* delegate) | 226 Profile::Delegate* delegate) |
231 : path_(path), | 227 : path_(path), |
232 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_( | 228 ALLOW_THIS_IN_INITIALIZER_LIST(visited_link_event_listener_( |
233 new VisitedLinkEventListener(this))), | 229 new VisitedLinkEventListener(this))), |
234 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 230 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
235 extension_devtools_manager_(NULL), | |
236 host_content_settings_map_(NULL), | 231 host_content_settings_map_(NULL), |
237 history_service_created_(false), | 232 history_service_created_(false), |
238 favicon_service_created_(false), | 233 favicon_service_created_(false), |
239 created_web_data_service_(false), | 234 created_web_data_service_(false), |
240 created_password_store_(false), | 235 created_password_store_(false), |
241 start_time_(Time::Now()), | 236 start_time_(Time::Now()), |
242 #if defined(OS_WIN) | 237 #if defined(OS_WIN) |
243 checked_instant_promo_(false), | 238 checked_instant_promo_(false), |
244 #endif | 239 #endif |
245 delegate_(delegate), | 240 delegate_(delegate), |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 host, &zoom_level); | 418 host, &zoom_level); |
424 DCHECK(success); | 419 DCHECK(success); |
425 host_zoom_map->SetZoomLevel(host, zoom_level); | 420 host_zoom_map->SetZoomLevel(host, zoom_level); |
426 } | 421 } |
427 } | 422 } |
428 | 423 |
429 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 424 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
430 content::Source<HostZoomMap>(host_zoom_map)); | 425 content::Source<HostZoomMap>(host_zoom_map)); |
431 } | 426 } |
432 | 427 |
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 | |
530 void ProfileImpl::InitPromoResources() { | 428 void ProfileImpl::InitPromoResources() { |
531 if (promo_resource_service_) | 429 if (promo_resource_service_) |
532 return; | 430 return; |
533 | 431 |
534 promo_resource_service_ = new PromoResourceService(this); | 432 promo_resource_service_ = new PromoResourceService(this); |
535 promo_resource_service_->StartAfterDelay(); | 433 promo_resource_service_->StartAfterDelay(); |
536 } | 434 } |
537 | 435 |
538 void ProfileImpl::InitRegisteredProtocolHandlers() { | 436 void ProfileImpl::InitRegisteredProtocolHandlers() { |
539 if (protocol_handler_registry_) | 437 if (protocol_handler_registry_) |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 // HistoryService will join with HistoryService's backend thread so that | 518 // HistoryService will join with HistoryService's backend thread so that |
621 // by the time the destructor has finished we're sure it will no longer call | 519 // by the time the destructor has finished we're sure it will no longer call |
622 // into the BookmarkModel. | 520 // into the BookmarkModel. |
623 history_service_ = NULL; | 521 history_service_ = NULL; |
624 bookmark_bar_model_.reset(); | 522 bookmark_bar_model_.reset(); |
625 | 523 |
626 // FaviconService depends on HistoryServce so make sure we delete | 524 // FaviconService depends on HistoryServce so make sure we delete |
627 // HistoryService first. | 525 // HistoryService first. |
628 favicon_service_.reset(); | 526 favicon_service_.reset(); |
629 | 527 |
630 if (extension_message_service_) | |
631 extension_message_service_->DestroyingProfile(); | |
632 | |
633 if (pref_proxy_config_tracker_.get()) | 528 if (pref_proxy_config_tracker_.get()) |
634 pref_proxy_config_tracker_->DetachFromPrefService(); | 529 pref_proxy_config_tracker_->DetachFromPrefService(); |
635 | 530 |
636 if (protocol_handler_registry_) | 531 if (protocol_handler_registry_) |
637 protocol_handler_registry_->Finalize(); | 532 protocol_handler_registry_->Finalize(); |
638 | 533 |
639 if (host_content_settings_map_) | 534 if (host_content_settings_map_) |
640 host_content_settings_map_->ShutdownOnUIThread(); | 535 host_content_settings_map_->ShutdownOnUIThread(); |
641 | 536 |
642 // This causes the Preferences file to be written to disk. | 537 // This causes the Preferences file to be written to disk. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 new VisitedLinkMaster(visited_link_event_listener_.get(), this)); | 582 new VisitedLinkMaster(visited_link_event_listener_.get(), this)); |
688 if (!visited_links->Init()) | 583 if (!visited_links->Init()) |
689 return NULL; | 584 return NULL; |
690 visited_link_master_.swap(visited_links); | 585 visited_link_master_.swap(visited_links); |
691 } | 586 } |
692 | 587 |
693 return visited_link_master_.get(); | 588 return visited_link_master_.get(); |
694 } | 589 } |
695 | 590 |
696 ExtensionService* ProfileImpl::GetExtensionService() { | 591 ExtensionService* ProfileImpl::GetExtensionService() { |
697 return extension_service_.get(); | 592 return ExtensionSystemFactory::GetForProfile(this)->extension_service(); |
698 } | 593 } |
699 | 594 |
700 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { | 595 UserScriptMaster* ProfileImpl::GetUserScriptMaster() { |
701 return user_script_master_.get(); | 596 return ExtensionSystemFactory::GetForProfile(this)->user_script_master(); |
702 } | |
703 | |
704 ExtensionDevToolsManager* ProfileImpl::GetExtensionDevToolsManager() { | |
705 return extension_devtools_manager_.get(); | |
706 } | 597 } |
707 | 598 |
708 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { | 599 ExtensionProcessManager* ProfileImpl::GetExtensionProcessManager() { |
709 return extension_process_manager_.get(); | 600 return ExtensionSystemFactory::GetForProfile(this)->process_manager(); |
710 } | |
711 | |
712 ExtensionMessageService* ProfileImpl::GetExtensionMessageService() { | |
713 return extension_message_service_.get(); | |
714 } | 601 } |
715 | 602 |
716 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { | 603 ExtensionEventRouter* ProfileImpl::GetExtensionEventRouter() { |
717 return extension_event_router_.get(); | 604 return ExtensionSystemFactory::GetForProfile(this)->event_router(); |
718 } | 605 } |
719 | 606 |
720 ExtensionSpecialStoragePolicy* | 607 ExtensionSpecialStoragePolicy* |
721 ProfileImpl::GetExtensionSpecialStoragePolicy() { | 608 ProfileImpl::GetExtensionSpecialStoragePolicy() { |
722 if (!extension_special_storage_policy_.get()) { | 609 if (!extension_special_storage_policy_.get()) { |
723 extension_special_storage_policy_ = new ExtensionSpecialStoragePolicy( | 610 extension_special_storage_policy_ = new ExtensionSpecialStoragePolicy( |
724 CookieSettings::Factory::GetForProfile(this)); | 611 CookieSettings::Factory::GetForProfile(this)); |
725 } | 612 } |
726 return extension_special_storage_policy_.get(); | 613 return extension_special_storage_policy_.get(); |
727 } | 614 } |
(...skipping 15 matching lines...) Expand all Loading... |
743 g_browser_process->local_state()); | 630 g_browser_process->local_state()); |
744 } | 631 } |
745 | 632 |
746 // The last session exited cleanly if there is no pref for | 633 // The last session exited cleanly if there is no pref for |
747 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. | 634 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. |
748 last_session_exited_cleanly_ = | 635 last_session_exited_cleanly_ = |
749 prefs_->GetBoolean(prefs::kSessionExitedCleanly); | 636 prefs_->GetBoolean(prefs::kSessionExitedCleanly); |
750 // Mark the session as open. | 637 // Mark the session as open. |
751 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); | 638 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); |
752 | 639 |
753 bool extensions_disabled = | |
754 prefs_->GetBoolean(prefs::kDisableExtensions) || | |
755 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); | |
756 | |
757 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 640 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
758 | 641 |
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 | |
767 DCHECK(!net_pref_observer_.get()); | 642 DCHECK(!net_pref_observer_.get()); |
768 net_pref_observer_.reset(new NetPrefObserver( | 643 net_pref_observer_.reset(new NetPrefObserver( |
769 prefs_.get(), | 644 prefs_.get(), |
770 prerender::PrerenderManagerFactory::GetForProfile(this), | 645 prerender::PrerenderManagerFactory::GetForProfile(this), |
771 predictor_)); | 646 predictor_)); |
772 | 647 |
773 DoFinalInit(); | 648 DoFinalInit(); |
774 } | 649 } |
775 | 650 |
776 PrefService* ProfileImpl::GetPrefs() { | 651 PrefService* ProfileImpl::GetPrefs() { |
(...skipping 24 matching lines...) Expand all Loading... |
801 // Even when Chromium is started in OTR mode, a normal profile is always | 676 // Even when Chromium is started in OTR mode, a normal profile is always |
802 // created first. | 677 // created first. |
803 if (!default_request_context_) | 678 if (!default_request_context_) |
804 default_request_context_ = request_context; | 679 default_request_context_ = request_context; |
805 | 680 |
806 return request_context; | 681 return request_context; |
807 } | 682 } |
808 | 683 |
809 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( | 684 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForRenderProcess( |
810 int renderer_child_id) { | 685 int renderer_child_id) { |
811 if (extension_service_.get()) { | 686 ExtensionService* extension_service = |
812 const Extension* installed_app = extension_service_-> | 687 ExtensionSystemFactory::GetForProfile(this)->extension_service(); |
| 688 if (extension_service) { |
| 689 const Extension* installed_app = extension_service-> |
813 GetInstalledAppForRenderer(renderer_child_id); | 690 GetInstalledAppForRenderer(renderer_child_id); |
814 if (installed_app != NULL && installed_app->is_storage_isolated() && | 691 if (installed_app != NULL && installed_app->is_storage_isolated() && |
815 installed_app->HasAPIPermission( | 692 installed_app->HasAPIPermission( |
816 ExtensionAPIPermission::kExperimental)) { | 693 ExtensionAPIPermission::kExperimental)) { |
817 return GetRequestContextForIsolatedApp(installed_app->id()); | 694 return GetRequestContextForIsolatedApp(installed_app->id()); |
818 } | 695 } |
819 } | 696 } |
820 return GetRequestContext(); | 697 return GetRequestContext(); |
821 } | 698 } |
822 | 699 |
(...skipping 15 matching lines...) Expand all Loading... |
838 | 715 |
839 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { | 716 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { |
840 return io_data_.GetExtensionsRequestContextGetter(); | 717 return io_data_.GetExtensionsRequestContextGetter(); |
841 } | 718 } |
842 | 719 |
843 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( | 720 net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( |
844 const std::string& app_id) { | 721 const std::string& app_id) { |
845 return io_data_.GetIsolatedAppRequestContextGetter(app_id); | 722 return io_data_.GetIsolatedAppRequestContextGetter(app_id); |
846 } | 723 } |
847 | 724 |
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 | |
873 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 725 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
874 return ssl_config_service_manager_->Get(); | 726 return ssl_config_service_manager_->Get(); |
875 } | 727 } |
876 | 728 |
877 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 729 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
878 if (!host_content_settings_map_.get()) { | 730 if (!host_content_settings_map_.get()) { |
879 host_content_settings_map_ = new HostContentSettingsMap( | 731 host_content_settings_map_ = new HostContentSettingsMap( |
880 GetPrefs(), GetExtensionService(), false); | 732 GetPrefs(), GetExtensionService(), false); |
881 } | 733 } |
882 return host_content_settings_map_.get(); | 734 return host_content_settings_map_.get(); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1242 SessionServiceFactory::GetForProfile(this); | 1094 SessionServiceFactory::GetForProfile(this); |
1243 } | 1095 } |
1244 | 1096 |
1245 TokenService* ProfileImpl::GetTokenService() { | 1097 TokenService* ProfileImpl::GetTokenService() { |
1246 if (!token_service_.get()) { | 1098 if (!token_service_.get()) { |
1247 token_service_.reset(new TokenService()); | 1099 token_service_.reset(new TokenService()); |
1248 } | 1100 } |
1249 return token_service_.get(); | 1101 return token_service_.get(); |
1250 } | 1102 } |
1251 | 1103 |
1252 ExtensionInfoMap* ProfileImpl::GetExtensionInfoMap() { | |
1253 return extension_info_map_.get(); | |
1254 } | |
1255 | |
1256 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { | 1104 ChromeURLDataManager* ProfileImpl::GetChromeURLDataManager() { |
1257 if (!chrome_url_data_manager_.get()) | 1105 if (!chrome_url_data_manager_.get()) |
1258 chrome_url_data_manager_.reset(new ChromeURLDataManager( | 1106 chrome_url_data_manager_.reset(new ChromeURLDataManager( |
1259 io_data_.GetChromeURLDataManagerBackendGetter())); | 1107 io_data_.GetChromeURLDataManagerBackendGetter())); |
1260 return chrome_url_data_manager_.get(); | 1108 return chrome_url_data_manager_.get(); |
1261 } | 1109 } |
1262 | 1110 |
1263 PromoCounter* ProfileImpl::GetInstantPromoCounter() { | 1111 PromoCounter* ProfileImpl::GetInstantPromoCounter() { |
1264 #if defined(OS_WIN) | 1112 #if defined(OS_WIN) |
1265 // TODO: enable this when we're ready to turn on the promo. | 1113 // 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... |
1461 FilePath* cache_path, | 1309 FilePath* cache_path, |
1462 int* max_size) { | 1310 int* max_size) { |
1463 DCHECK(cache_path); | 1311 DCHECK(cache_path); |
1464 DCHECK(max_size); | 1312 DCHECK(max_size); |
1465 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1313 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1466 if (!path.empty()) | 1314 if (!path.empty()) |
1467 *cache_path = path; | 1315 *cache_path = path; |
1468 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1316 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1469 prefs_->GetInteger(prefs::kDiskCacheSize); | 1317 prefs_->GetInteger(prefs::kDiskCacheSize); |
1470 } | 1318 } |
OLD | NEW |