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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "chrome/common/chrome_paths_internal.h" | 78 #include "chrome/common/chrome_paths_internal.h" |
79 #include "chrome/common/chrome_switches.h" | 79 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/chrome_version_info.h" | 80 #include "chrome/common/chrome_version_info.h" |
81 #include "chrome/common/pref_names.h" | 81 #include "chrome/common/pref_names.h" |
82 #include "chrome/common/url_constants.h" | 82 #include "chrome/common/url_constants.h" |
83 #include "content/public/browser/browser_thread.h" | 83 #include "content/public/browser/browser_thread.h" |
84 #include "content/public/browser/dom_storage_context.h" | 84 #include "content/public/browser/dom_storage_context.h" |
85 #include "content/public/browser/host_zoom_map.h" | 85 #include "content/public/browser/host_zoom_map.h" |
86 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
87 #include "content/public/browser/render_process_host.h" | 87 #include "content/public/browser/render_process_host.h" |
| 88 #include "content/public/browser/storage_partition.h" |
88 #include "content/public/browser/user_metrics.h" | 89 #include "content/public/browser/user_metrics.h" |
89 #include "grit/chromium_strings.h" | 90 #include "grit/chromium_strings.h" |
90 #include "grit/generated_resources.h" | 91 #include "grit/generated_resources.h" |
91 #include "ui/base/l10n/l10n_util.h" | 92 #include "ui/base/l10n/l10n_util.h" |
92 | 93 |
93 #if defined(ENABLE_CONFIGURATION_POLICY) | 94 #if defined(ENABLE_CONFIGURATION_POLICY) |
94 #include "chrome/browser/policy/browser_policy_connector.h" | 95 #include "chrome/browser/policy/browser_policy_connector.h" |
95 #else | 96 #else |
96 #include "chrome/browser/policy/policy_service_stub.h" | 97 #include "chrome/browser/policy/policy_service_stub.h" |
97 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 98 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 io_data_.GetResourceContextNoInit()); | 418 io_data_.GetResourceContextNoInit()); |
418 | 419 |
419 // Delay README creation to not impact startup performance. | 420 // Delay README creation to not impact startup performance. |
420 BrowserThread::PostDelayedTask( | 421 BrowserThread::PostDelayedTask( |
421 BrowserThread::FILE, FROM_HERE, | 422 BrowserThread::FILE, FROM_HERE, |
422 base::Bind(&EnsureReadmeFile, GetPath()), | 423 base::Bind(&EnsureReadmeFile, GetPath()), |
423 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); | 424 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); |
424 | 425 |
425 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 426 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
426 switches::kDisableRestoreSessionState)) { | 427 switches::kDisableRestoreSessionState)) { |
427 content::BrowserContext::GetDefaultDOMStorageContext(this)-> | 428 content::BrowserContext::GetDefaultStoragePartition(this)-> |
428 SetSaveSessionStorageOnDisk(); | 429 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); |
429 } | 430 } |
430 | 431 |
431 // Creation has been finished. | 432 // Creation has been finished. |
432 if (delegate_) | 433 if (delegate_) |
433 delegate_->OnProfileCreated(this, true, is_new_profile); | 434 delegate_->OnProfileCreated(this, true, is_new_profile); |
434 | 435 |
435 content::NotificationService::current()->Notify( | 436 content::NotificationService::current()->Notify( |
436 chrome::NOTIFICATION_PROFILE_CREATED, | 437 chrome::NOTIFICATION_PROFILE_CREATED, |
437 content::Source<Profile>(this), | 438 content::Source<Profile>(this), |
438 content::NotificationService::NoDetails()); | 439 content::NotificationService::NoDetails()); |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 if (!path.empty()) | 1076 if (!path.empty()) |
1076 *cache_path = path; | 1077 *cache_path = path; |
1077 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1078 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1078 prefs_->GetInteger(prefs::kDiskCacheSize); | 1079 prefs_->GetInteger(prefs::kDiskCacheSize); |
1079 } | 1080 } |
1080 | 1081 |
1081 base::Callback<ChromeURLDataManagerBackend*(void)> | 1082 base::Callback<ChromeURLDataManagerBackend*(void)> |
1082 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1083 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1083 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1084 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1084 } | 1085 } |
OLD | NEW |