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