OLD | NEW |
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 #ifndef CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ | 5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ |
6 #define CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ | 6 #define CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 explicit ProfileResetter(Profile* profile); | 40 explicit ProfileResetter(Profile* profile); |
41 ~ProfileResetter(); | 41 ~ProfileResetter(); |
42 | 42 |
43 // Resets |resettable_flags| and calls |callback| on the UI thread on | 43 // Resets |resettable_flags| and calls |callback| on the UI thread on |
44 // completion. If |resettable_flags| contains EXTENSIONS, these are handled | 44 // completion. If |resettable_flags| contains EXTENSIONS, these are handled |
45 // according to |extension_handling|. | 45 // according to |extension_handling|. |
46 void Reset(ResettableFlags resettable_flags, | 46 void Reset(ResettableFlags resettable_flags, |
47 ExtensionHandling extension_handling, | 47 ExtensionHandling extension_handling, |
48 const base::Closure& callback); | 48 const base::Closure& callback); |
49 | 49 |
| 50 bool IsActive() const; |
| 51 |
50 private: | 52 private: |
51 // Marks |resettable| as done and triggers |callback_| if all pending jobs | 53 // Marks |resettable| as done and triggers |callback_| if all pending jobs |
52 // have completed. | 54 // have completed. |
53 void MarkAsDone(Resettable resettable); | 55 void MarkAsDone(Resettable resettable); |
54 | 56 |
55 void ResetDefaultSearchEngine(); | 57 void ResetDefaultSearchEngine(); |
56 void ResetHomepage(); | 58 void ResetHomepage(); |
57 void ResetContentSettings(); | 59 void ResetContentSettings(); |
58 void ResetCookiesAndSiteData(); | 60 void ResetCookiesAndSiteData(); |
59 void ResetExtensions(ExtensionHandling extension_handling); | 61 void ResetExtensions(ExtensionHandling extension_handling); |
60 | 62 |
61 Profile* profile_; | 63 Profile* profile_; |
62 | 64 |
63 // Flags of a Resetable indicating which reset operations we are still waiting | 65 // Flags of a Resetable indicating which reset operations we are still waiting |
64 // for. | 66 // for. |
65 ResettableFlags pending_reset_flags_; | 67 ResettableFlags pending_reset_flags_; |
66 | 68 |
67 // Called on UI thread when reset has been completed. | 69 // Called on UI thread when reset has been completed. |
68 base::Closure callback_; | 70 base::Closure callback_; |
69 | 71 |
70 DISALLOW_COPY_AND_ASSIGN(ProfileResetter); | 72 DISALLOW_COPY_AND_ASSIGN(ProfileResetter); |
71 }; | 73 }; |
72 | 74 |
73 #endif // CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ | 75 #endif // CHROME_BROWSER_PROFILE_RESETTER_PROFILE_RESETTER_H_ |
OLD | NEW |