Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 271673006: Eliminate all code related to the AutomaticProfileResetter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from gab@. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 bool incognito_pref_store) { 266 bool incognito_pref_store) {
267 #if defined(ENABLE_EXTENSIONS) 267 #if defined(ENABLE_EXTENSIONS)
268 return new ExtensionPrefStore( 268 return new ExtensionPrefStore(
269 ExtensionPrefValueMapFactory::GetForBrowserContext(profile), 269 ExtensionPrefValueMapFactory::GetForBrowserContext(profile),
270 incognito_pref_store); 270 incognito_pref_store);
271 #else 271 #else
272 return NULL; 272 return NULL;
273 #endif 273 #endif
274 } 274 }
275 275
276 #if !defined(OS_ANDROID)
277 // Deletes the file that was used by the AutomaticProfileResetter service, which
278 // has been since removed, to store that the prompt had already been shown.
gab 2014/07/30 19:46:53 nit: s/has been since/has since been/
engedy 2014/07/31 08:10:50 Done.
279 // TODO(engedy): Remove this and caller in M42 or later. See crbug.com/398813.
280 void DeleteResetPromptMementoFile(const base::FilePath& profile_dir) {
281 base::FilePath memento_path =
282 profile_dir.Append(FILE_PATH_LITERAL("Reset Prompt Memento"));
283 base::DeleteFile(memento_path, false);
284 }
285 #endif
286
276 } // namespace 287 } // namespace
277 288
278 // static 289 // static
279 Profile* Profile::CreateProfile(const base::FilePath& path, 290 Profile* Profile::CreateProfile(const base::FilePath& path,
280 Delegate* delegate, 291 Delegate* delegate,
281 CreateMode create_mode) { 292 CreateMode create_mode) {
282 TRACE_EVENT_BEGIN1("browser", 293 TRACE_EVENT_BEGIN1("browser",
283 "Profile::CreateProfile", 294 "Profile::CreateProfile",
284 "profile_path", 295 "profile_path",
285 path.value().c_str()); 296 path.value().c_str());
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 base::TimeDelta::FromMilliseconds(create_readme_delay_ms)); 642 base::TimeDelta::FromMilliseconds(create_readme_delay_ms));
632 643
633 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk"); 644 TRACE_EVENT0("browser", "ProfileImpl::SetSaveSessionStorageOnDisk");
634 content::BrowserContext::GetDefaultStoragePartition(this)-> 645 content::BrowserContext::GetDefaultStoragePartition(this)->
635 GetDOMStorageContext()->SetSaveSessionStorageOnDisk(); 646 GetDOMStorageContext()->SetSaveSessionStorageOnDisk();
636 647
637 // The DomDistillerViewerSource is not a normal WebUI so it must be registered 648 // The DomDistillerViewerSource is not a normal WebUI so it must be registered
638 // as a URLDataSource early. 649 // as a URLDataSource early.
639 RegisterDomDistillerViewerSource(this); 650 RegisterDomDistillerViewerSource(this);
640 651
652 #if !defined(OS_ANDROID)
653 BrowserThread::GetBlockingPool()->PostDelayedWorkerTask(
654 FROM_HERE,
655 base::Bind(&DeleteResetPromptMementoFile, GetPath()),
656 base::TimeDelta::FromMilliseconds(2 * create_readme_delay_ms));
657 #endif
658
641 // Creation has been finished. 659 // Creation has been finished.
642 TRACE_EVENT_END1("browser", 660 TRACE_EVENT_END1("browser",
643 "Profile::CreateProfile", 661 "Profile::CreateProfile",
644 "profile_path", 662 "profile_path",
645 path_.value().c_str()); 663 path_.value().c_str());
646 664
647 #if defined(OS_CHROMEOS) 665 #if defined(OS_CHROMEOS)
648 if (chromeos::LoginUtils::Get()->RestartToApplyPerSessionFlagsIfNeed(this, 666 if (chromeos::LoginUtils::Get()->RestartToApplyPerSessionFlagsIfNeed(this,
649 true)) { 667 true)) {
650 return; 668 return;
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 ProfileImpl::CreateDomainReliabilityMonitor() { 1360 ProfileImpl::CreateDomainReliabilityMonitor() {
1343 domain_reliability::DomainReliabilityService* service = 1361 domain_reliability::DomainReliabilityService* service =
1344 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1362 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1345 GetForBrowserContext(this); 1363 GetForBrowserContext(this);
1346 if (!service) 1364 if (!service)
1347 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1365 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1348 1366
1349 return service->CreateMonitor( 1367 return service->CreateMonitor(
1350 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1368 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1351 } 1369 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698