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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 bool incognito_pref_store) { | 265 bool incognito_pref_store) { |
266 #if defined(ENABLE_EXTENSIONS) | 266 #if defined(ENABLE_EXTENSIONS) |
267 return new ExtensionPrefStore( | 267 return new ExtensionPrefStore( |
268 ExtensionPrefValueMapFactory::GetForBrowserContext(profile), | 268 ExtensionPrefValueMapFactory::GetForBrowserContext(profile), |
269 incognito_pref_store); | 269 incognito_pref_store); |
270 #else | 270 #else |
271 return NULL; | 271 return NULL; |
272 #endif | 272 #endif |
273 } | 273 } |
274 | 274 |
| 275 #if !defined(OS_ANDROID) |
| 276 // Deletes the file that was used by the AutomaticProfileResetter service, which |
| 277 // has since been removed, to store that the prompt had already been shown. |
| 278 // TODO(engedy): Remove this and caller in M42 or later. See crbug.com/398813. |
| 279 void DeleteResetPromptMementoFile(const base::FilePath& profile_dir) { |
| 280 base::FilePath memento_path = |
| 281 profile_dir.Append(FILE_PATH_LITERAL("Reset Prompt Memento")); |
| 282 base::DeleteFile(memento_path, false); |
| 283 } |
| 284 #endif |
| 285 |
275 } // namespace | 286 } // namespace |
276 | 287 |
277 // static | 288 // static |
278 Profile* Profile::CreateProfile(const base::FilePath& path, | 289 Profile* Profile::CreateProfile(const base::FilePath& path, |
279 Delegate* delegate, | 290 Delegate* delegate, |
280 CreateMode create_mode) { | 291 CreateMode create_mode) { |
281 TRACE_EVENT_BEGIN1("browser", | 292 TRACE_EVENT_BEGIN1("browser", |
282 "Profile::CreateProfile", | 293 "Profile::CreateProfile", |
283 "profile_path", | 294 "profile_path", |
284 path.value().c_str()); | 295 path.value().c_str()); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); | 641 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); |
631 | 642 |
632 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); | 643 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); |
633 content::BrowserContext::GetDefaultStoragePartition(this)-> | 644 content::BrowserContext::GetDefaultStoragePartition(this)-> |
634 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); | 645 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); |
635 | 646 |
636 // The DomDistillerViewerSource is not a normal WebUI so it must be registered | 647 // The DomDistillerViewerSource is not a normal WebUI so it must be registered |
637 // as a URLDataSource early. | 648 // as a URLDataSource early. |
638 RegisterDomDistillerViewerSource(this); | 649 RegisterDomDistillerViewerSource(this); |
639 | 650 |
| 651 #if !defined(OS_ANDROID) |
| 652 BrowserThread::GetBlockingPool()->PostDelayedWorkerTask( |
| 653 FROM_HERE, |
| 654 base::Bind(&DeleteResetPromptMementoFile, GetPath()), |
| 655 base::TimeDelta::FromMilliseconds(2 * create_readme_delay_ms)); |
| 656 #endif |
| 657 |
640 // Creation has been finished. | 658 // Creation has been finished. |
641 TRACE_EVENT_END1("browser", | 659 TRACE_EVENT_END1("browser", |
642 "Profile::CreateProfile", | 660 "Profile::CreateProfile", |
643 "profile_path", | 661 "profile_path", |
644 path_.value().c_str()); | 662 path_.value().c_str()); |
645 | 663 |
646 #if defined(OS_CHROMEOS) | 664 #if defined(OS_CHROMEOS) |
647 if (chromeos::LoginUtils::Get()->RestartToApplyPerSessionFlagsIfNeed(this, | 665 if (chromeos::LoginUtils::Get()->RestartToApplyPerSessionFlagsIfNeed(this, |
648 true)) { | 666 true)) { |
649 return; | 667 return; |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 ProfileImpl::CreateDomainReliabilityMonitor() { | 1361 ProfileImpl::CreateDomainReliabilityMonitor() { |
1344 domain_reliability::DomainReliabilityService* service = | 1362 domain_reliability::DomainReliabilityService* service = |
1345 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1363 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1346 GetForBrowserContext(this); | 1364 GetForBrowserContext(this); |
1347 if (!service) | 1365 if (!service) |
1348 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1366 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1349 | 1367 |
1350 return service->CreateMonitor( | 1368 return service->CreateMonitor( |
1351 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1369 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1352 } | 1370 } |
OLD | NEW |