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

Side by Side Diff: chrome/browser/profile_resetter/profile_resetter.cc

Issue 14924002: WebUI for Profile Settings Reset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed vasilii's comments and fixed a merge error Created 7 years, 7 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/profile_resetter/profile_resetter.h" 5 #include "chrome/browser/profile_resetter/profile_resetter.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 9
10 ProfileResetter::ProfileResetter(Profile* profile) 10 ProfileResetter::ProfileResetter(Profile* profile)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 if (resettable_flags & EXTENSIONS) { 56 if (resettable_flags & EXTENSIONS) {
57 reset_triggered_for_flags |= EXTENSIONS; 57 reset_triggered_for_flags |= EXTENSIONS;
58 ResetExtensions(extension_handling); 58 ResetExtensions(extension_handling);
59 } 59 }
60 60
61 DCHECK_EQ(resettable_flags, reset_triggered_for_flags); 61 DCHECK_EQ(resettable_flags, reset_triggered_for_flags);
62 } 62 }
63 63
64 bool ProfileResetter::IsActive() const {
65 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
66 return pending_reset_flags_ != 0;
67 }
68
64 void ProfileResetter::MarkAsDone(Resettable resettable) { 69 void ProfileResetter::MarkAsDone(Resettable resettable) {
65 DCHECK(CalledOnValidThread()); 70 DCHECK(CalledOnValidThread());
66 71
67 // Check that we are never called twice or unexpectedly. 72 // Check that we are never called twice or unexpectedly.
68 CHECK(pending_reset_flags_ & resettable); 73 CHECK(pending_reset_flags_ & resettable);
69 74
70 pending_reset_flags_ &= ~resettable; 75 pending_reset_flags_ &= ~resettable;
71 76
72 if (!pending_reset_flags_) 77 if (!pending_reset_flags_)
73 callback_.Run(); 78 callback_.Run();
(...skipping 26 matching lines...) Expand all
100 // TODO(battre/vabr): Implement 105 // TODO(battre/vabr): Implement
101 MarkAsDone(COOKIES_AND_SITE_DATA); 106 MarkAsDone(COOKIES_AND_SITE_DATA);
102 } 107 }
103 108
104 void ProfileResetter::ResetExtensions(ExtensionHandling extension_handling) { 109 void ProfileResetter::ResetExtensions(ExtensionHandling extension_handling) {
105 DCHECK(CalledOnValidThread()); 110 DCHECK(CalledOnValidThread());
106 NOTIMPLEMENTED(); 111 NOTIMPLEMENTED();
107 // TODO(battre/vabr): Implement 112 // TODO(battre/vabr): Implement
108 MarkAsDone(EXTENSIONS); 113 MarkAsDone(EXTENSIONS);
109 } 114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698