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