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/download_manager.h" | 20 #include "chrome/browser/download/download_manager.h" |
21 #include "chrome/browser/extensions/extension_info_map.h" | 21 #include "chrome/browser/extensions/extension_info_map.h" |
22 #include "chrome/browser/extensions/extension_message_service.h" | 22 #include "chrome/browser/extensions/extension_message_service.h" |
23 #include "chrome/browser/extensions/extension_pref_store.h" | 23 #include "chrome/browser/extensions/extension_pref_store.h" |
24 #include "chrome/browser/extensions/extension_process_manager.h" | 24 #include "chrome/browser/extensions/extension_process_manager.h" |
25 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
26 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 26 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
27 #include "chrome/browser/extensions/extension_webrequest_api.h" | 27 #include "chrome/browser/extensions/extension_webrequest_api.h" |
28 #include "chrome/browser/net/pref_proxy_config_service.h" | 28 #include "chrome/browser/net/pref_proxy_config_service.h" |
| 29 #include "chrome/browser/prefs/incognito_mode_availability_prefs.h" |
29 #include "chrome/browser/prefs/pref_service.h" | 30 #include "chrome/browser/prefs/pref_service.h" |
30 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 31 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
31 #include "chrome/browser/profiles/profile_dependency_manager.h" | 32 #include "chrome/browser/profiles/profile_dependency_manager.h" |
32 #include "chrome/browser/sync/profile_sync_service.h" | 33 #include "chrome/browser/sync/profile_sync_service.h" |
33 #include "chrome/browser/themes/theme_service.h" | 34 #include "chrome/browser/themes/theme_service.h" |
34 #include "chrome/browser/transport_security_persister.h" | 35 #include "chrome/browser/transport_security_persister.h" |
35 #include "chrome/browser/ui/browser_list.h" | 36 #include "chrome/browser/ui/browser_list.h" |
36 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 37 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
37 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 38 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
38 #include "chrome/browser/ui/webui/extension_icon_source.h" | 39 #include "chrome/browser/ui/webui/extension_icon_source.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 : profile_(real_profile), | 231 : profile_(real_profile), |
231 prefs_(real_profile->GetOffTheRecordPrefs()), | 232 prefs_(real_profile->GetOffTheRecordPrefs()), |
232 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), | 233 ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
233 start_time_(Time::Now()) { | 234 start_time_(Time::Now()) { |
234 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); | 235 extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
235 | 236 |
236 BrowserList::AddObserver(this); | 237 BrowserList::AddObserver(this); |
237 | 238 |
238 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 239 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
239 | 240 |
240 DCHECK(real_profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)); | 241 DCHECK_NE( |
| 242 IncognitoModeAvailabilityPrefs::DISABLED, |
| 243 real_profile->GetPrefs()->GetInteger( |
| 244 prefs::kIncognitoModeAvailability)); |
241 | 245 |
242 // TODO(oshima): Remove the need to eagerly initialize the request context | 246 // TODO(oshima): Remove the need to eagerly initialize the request context |
243 // getter. chromeos::OnlineAttempt is illegally trying to access this | 247 // getter. chromeos::OnlineAttempt is illegally trying to access this |
244 // Profile member from a thread other than the UI thread, so we need to | 248 // Profile member from a thread other than the UI thread, so we need to |
245 // prevent a race. | 249 // prevent a race. |
246 #if defined(OS_CHROMEOS) | 250 #if defined(OS_CHROMEOS) |
247 GetRequestContext(); | 251 GetRequestContext(); |
248 #endif // defined(OS_CHROMEOS) | 252 #endif // defined(OS_CHROMEOS) |
249 | 253 |
250 // Make the chrome//extension-icon/ resource available. | 254 // Make the chrome//extension-icon/ resource available. |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 }; | 861 }; |
858 #endif | 862 #endif |
859 | 863 |
860 Profile* Profile::CreateOffTheRecordProfile() { | 864 Profile* Profile::CreateOffTheRecordProfile() { |
861 #if defined(OS_CHROMEOS) | 865 #if defined(OS_CHROMEOS) |
862 if (Profile::IsGuestSession()) | 866 if (Profile::IsGuestSession()) |
863 return new GuestSessionProfile(this); | 867 return new GuestSessionProfile(this); |
864 #endif | 868 #endif |
865 return new OffTheRecordProfileImpl(this); | 869 return new OffTheRecordProfileImpl(this); |
866 } | 870 } |
OLD | NEW |