| 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.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "chrome/browser/background/background_contents_service_factory.h" | 17 #include "chrome/browser/background/background_contents_service_factory.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/content_settings/host_content_settings_map.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 20 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 21 #include "chrome/browser/download/download_manager.h" | 21 #include "chrome/browser/download/download_manager.h" |
| 22 #include "chrome/browser/extensions/extension_info_map.h" | 22 #include "chrome/browser/extensions/extension_info_map.h" |
| 23 #include "chrome/browser/extensions/extension_message_service.h" | 23 #include "chrome/browser/extensions/extension_message_service.h" |
| 24 #include "chrome/browser/extensions/extension_pref_store.h" | 24 #include "chrome/browser/extensions/extension_pref_store.h" |
| 25 #include "chrome/browser/extensions/extension_process_manager.h" | 25 #include "chrome/browser/extensions/extension_process_manager.h" |
| 26 #include "chrome/browser/extensions/extension_service.h" | 26 #include "chrome/browser/extensions/extension_service.h" |
| 27 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 27 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 28 #include "chrome/browser/extensions/extension_webrequest_api.h" | 28 #include "chrome/browser/extensions/extension_webrequest_api.h" |
| 29 #include "chrome/browser/net/pref_proxy_config_service.h" | 29 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 30 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 30 #include "chrome/browser/prefs/pref_service.h" | 31 #include "chrome/browser/prefs/pref_service.h" |
| 31 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 32 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
| 32 #include "chrome/browser/profiles/profile_dependency_manager.h" | 33 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 33 #include "chrome/browser/sync/profile_sync_service.h" | 34 #include "chrome/browser/sync/profile_sync_service.h" |
| 34 #include "chrome/browser/themes/theme_service.h" | 35 #include "chrome/browser/themes/theme_service.h" |
| 35 #include "chrome/browser/transport_security_persister.h" | 36 #include "chrome/browser/transport_security_persister.h" |
| 36 #include "chrome/browser/ui/browser_list.h" | 37 #include "chrome/browser/ui/browser_list.h" |
| 37 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 38 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 38 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 39 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 39 #include "chrome/browser/ui/webui/extension_icon_source.h" | 40 #include "chrome/browser/ui/webui/extension_icon_source.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 : profile_(real_profile), | 232 : profile_(real_profile), |
| 232 prefs_(real_profile->GetOffTheRecordPrefs()), | 233 prefs_(real_profile->GetOffTheRecordPrefs()), |
| 233 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 234 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
| 234 start_time_(Time::Now()) { | 235 start_time_(Time::Now()) { |
| 235 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | 236 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
| 236 | 237 |
| 237 BrowserList::AddObserver(this); | 238 BrowserList::AddObserver(this); |
| 238 | 239 |
| 239 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 240 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
| 240 | 241 |
| 241 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); | 242 DCHECK_NE(IncognitoModePrefs::DISABLED, |
| 243 IncognitoModePrefs::GetAvailability(real_profile->GetPrefs())); |
| 242 | 244 |
| 243 // TODO(oshima): Remove the need to eagerly initialize the request context | 245 // TODO(oshima): Remove the need to eagerly initialize the request context |
| 244 // getter. chromeos::OnlineAttempt is illegally trying to access this | 246 // getter. chromeos::OnlineAttempt is illegally trying to access this |
| 245 // Profile member from a thread other than the UI thread, so we need to | 247 // Profile member from a thread other than the UI thread, so we need to |
| 246 // prevent a race. | 248 // prevent a race. |
| 247 #if defined(OS_CHROMEOS) | 249 #if defined(OS_CHROMEOS) |
| 248 GetRequestContext(); | 250 GetRequestContext(); |
| 249 #endif // defined(OS_CHROMEOS) | 251 #endif // defined(OS_CHROMEOS) |
| 250 | 252 |
| 251 // Make the chrome//extension-icon/ resource available. | 253 // Make the chrome//extension-icon/ resource available. |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 }; | 863 }; |
| 862 #endif | 864 #endif |
| 863 | 865 |
| 864 Profile* Profile::CreateOffTheRecordProfile() { | 866 Profile* Profile::CreateOffTheRecordProfile() { |
| 865 #if defined(OS_CHROMEOS) | 867 #if defined(OS_CHROMEOS) |
| 866 if (Profile::IsGuestSession()) | 868 if (Profile::IsGuestSession()) |
| 867 return new GuestSessionProfile(this); | 869 return new GuestSessionProfile(this); |
| 868 #endif | 870 #endif |
| 869 return new OffTheRecordProfileImpl(this); | 871 return new OffTheRecordProfileImpl(this); |
| 870 } | 872 } |
| OLD | NEW |