OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 28 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
29 #include "chrome/browser/download/download_manager.h" | 29 #include "chrome/browser/download/download_manager.h" |
30 #include "chrome/browser/extensions/extension_devtools_manager.h" | 30 #include "chrome/browser/extensions/extension_devtools_manager.h" |
31 #include "chrome/browser/extensions/extension_error_reporter.h" | 31 #include "chrome/browser/extensions/extension_error_reporter.h" |
32 #include "chrome/browser/extensions/extension_event_router.h" | 32 #include "chrome/browser/extensions/extension_event_router.h" |
33 #include "chrome/browser/extensions/extension_info_map.h" | 33 #include "chrome/browser/extensions/extension_info_map.h" |
34 #include "chrome/browser/extensions/extension_message_service.h" | 34 #include "chrome/browser/extensions/extension_message_service.h" |
35 #include "chrome/browser/extensions/extension_pref_store.h" | 35 #include "chrome/browser/extensions/extension_pref_store.h" |
36 #include "chrome/browser/extensions/extension_process_manager.h" | 36 #include "chrome/browser/extensions/extension_process_manager.h" |
37 #include "chrome/browser/extensions/extension_service.h" | 37 #include "chrome/browser/extensions/extension_service.h" |
| 38 #include "chrome/browser/extensions/extension_settings.h" |
38 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 39 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
39 #include "chrome/browser/extensions/user_script_master.h" | 40 #include "chrome/browser/extensions/user_script_master.h" |
40 #include "chrome/browser/favicon/favicon_service.h" | 41 #include "chrome/browser/favicon/favicon_service.h" |
41 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" | 42 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" |
42 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 43 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
43 #include "chrome/browser/history/history.h" | 44 #include "chrome/browser/history/history.h" |
44 #include "chrome/browser/history/shortcuts_backend.h" | 45 #include "chrome/browser/history/shortcuts_backend.h" |
45 #include "chrome/browser/history/top_sites.h" | 46 #include "chrome/browser/history/top_sites.h" |
46 #include "chrome/browser/instant/instant_controller.h" | 47 #include "chrome/browser/instant/instant_controller.h" |
47 #include "chrome/browser/metrics/metrics_service.h" | 48 #include "chrome/browser/metrics/metrics_service.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (!extensions_enabled) | 474 if (!extensions_enabled) |
474 autoupdate_enabled = false; | 475 autoupdate_enabled = false; |
475 else | 476 else |
476 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); | 477 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); |
477 #endif | 478 #endif |
478 extension_service_.reset(new ExtensionService( | 479 extension_service_.reset(new ExtensionService( |
479 this, | 480 this, |
480 CommandLine::ForCurrentProcess(), | 481 CommandLine::ForCurrentProcess(), |
481 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 482 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
482 extension_prefs_.get(), | 483 extension_prefs_.get(), |
| 484 extension_settings_.get(), |
483 autoupdate_enabled, | 485 autoupdate_enabled, |
484 extensions_enabled)); | 486 extensions_enabled)); |
485 | 487 |
486 RegisterComponentExtensions(); | 488 RegisterComponentExtensions(); |
487 extension_service_->Init(); | 489 extension_service_->Init(); |
488 | 490 |
489 if (extensions_enabled) { | 491 if (extensions_enabled) { |
490 // Load any extensions specified with --load-extension. | 492 // Load any extensions specified with --load-extension. |
491 if (command_line->HasSwitch(switches::kLoadExtension)) { | 493 if (command_line->HasSwitch(switches::kLoadExtension)) { |
492 FilePath path = command_line->GetSwitchValuePath( | 494 FilePath path = command_line->GetSwitchValuePath( |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 // Make sure we save to disk that the session has opened. | 887 // Make sure we save to disk that the session has opened. |
886 prefs_->ScheduleSavePersistentPrefs(); | 888 prefs_->ScheduleSavePersistentPrefs(); |
887 | 889 |
888 // Ensure that preferences set by extensions are restored in the profile | 890 // Ensure that preferences set by extensions are restored in the profile |
889 // as early as possible. The constructor takes care of that. | 891 // as early as possible. The constructor takes care of that. |
890 extension_prefs_.reset(new ExtensionPrefs( | 892 extension_prefs_.reset(new ExtensionPrefs( |
891 prefs_.get(), | 893 prefs_.get(), |
892 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 894 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
893 GetExtensionPrefValueMap())); | 895 GetExtensionPrefValueMap())); |
894 | 896 |
| 897 extension_settings_ = new ExtensionSettings( |
| 898 GetPath().AppendASCII(ExtensionService::kSettingsDirectoryName)); |
| 899 |
895 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 900 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
896 | 901 |
897 DCHECK(!net_pref_observer_.get()); | 902 DCHECK(!net_pref_observer_.get()); |
898 net_pref_observer_.reset( | 903 net_pref_observer_.reset( |
899 new NetPrefObserver(prefs_.get(), GetPrerenderManager())); | 904 new NetPrefObserver(prefs_.get(), GetPrerenderManager())); |
900 | 905 |
901 DoFinalInit(); | 906 DoFinalInit(); |
902 } | 907 } |
903 | 908 |
904 PrefService* ProfileImpl::GetPrefs() { | 909 PrefService* ProfileImpl::GetPrefs() { |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 new prerender::PrerenderManager( | 1744 new prerender::PrerenderManager( |
1740 this, g_browser_process->prerender_tracker())); | 1745 this, g_browser_process->prerender_tracker())); |
1741 #if defined(OS_CHROMEOS) | 1746 #if defined(OS_CHROMEOS) |
1742 prerender_manager_->AddCondition( | 1747 prerender_manager_->AddCondition( |
1743 new chromeos::PrerenderConditionNetwork( | 1748 new chromeos::PrerenderConditionNetwork( |
1744 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); | 1749 chromeos::CrosLibrary::Get()->GetNetworkLibrary())); |
1745 #endif | 1750 #endif |
1746 } | 1751 } |
1747 return prerender_manager_.get(); | 1752 return prerender_manager_.get(); |
1748 } | 1753 } |
OLD | NEW |