| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_AUTOMATIC_PROFILE_RESETTER_H_ | 5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_ |
| 6 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_ | 6 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // The reset bubble was suppressed (not shown) because another bubble was | 60 // The reset bubble was suppressed (not shown) because another bubble was |
| 61 // already being shown at the time. Regardless, however, the user initiated | 61 // already being shown at the time. Regardless, however, the user initiated |
| 62 // or refrained from doing a reset (respectively) from the conventional, | 62 // or refrained from doing a reset (respectively) from the conventional, |
| 63 // WebUI-based reset dialog. | 63 // WebUI-based reset dialog. |
| 64 PROMPT_NOT_SHOWN_BUBBLE_BUT_HAD_WEBUI_RESET, | 64 PROMPT_NOT_SHOWN_BUBBLE_BUT_HAD_WEBUI_RESET, |
| 65 PROMPT_NOT_SHOWN_BUBBLE_BUT_HAD_WEBUI_NO_RESET, | 65 PROMPT_NOT_SHOWN_BUBBLE_BUT_HAD_WEBUI_NO_RESET, |
| 66 PROMPT_RESULT_MAX | 66 PROMPT_RESULT_MAX |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 explicit AutomaticProfileResetter(Profile* profile); | 69 explicit AutomaticProfileResetter(Profile* profile); |
| 70 virtual ~AutomaticProfileResetter(); | 70 ~AutomaticProfileResetter() override; |
| 71 | 71 |
| 72 // Initializes the service if it is enabled in the field trial. Otherwise, | 72 // Initializes the service if it is enabled in the field trial. Otherwise, |
| 73 // skips the initialization steps, and also permanently disables the service. | 73 // skips the initialization steps, and also permanently disables the service. |
| 74 // Called by AutomaticProfileResetterFactory. | 74 // Called by AutomaticProfileResetterFactory. |
| 75 void Initialize(); | 75 void Initialize(); |
| 76 | 76 |
| 77 // Fires up the service by unleashing the asynchronous evaluation flow, unless | 77 // Fires up the service by unleashing the asynchronous evaluation flow, unless |
| 78 // the service has been already disabled in Initialize() or there is no | 78 // the service has been already disabled in Initialize() or there is no |
| 79 // |program_| to run (in which case the service also gets disabled). | 79 // |program_| to run (in which case the service also gets disabled). |
| 80 // Called by the AutomaticProfileResetterFactory. | 80 // Called by the AutomaticProfileResetterFactory. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Should be called before Activate(). | 132 // Should be called before Activate(). |
| 133 void SetDelegateForTesting( | 133 void SetDelegateForTesting( |
| 134 scoped_ptr<AutomaticProfileResetterDelegate> delegate); | 134 scoped_ptr<AutomaticProfileResetterDelegate> delegate); |
| 135 | 135 |
| 136 // Should be called before Activate(). Sets the task runner to be used to post | 136 // Should be called before Activate(). Sets the task runner to be used to post |
| 137 // task |PrepareEvaluationFlow| in a delayed manner. | 137 // task |PrepareEvaluationFlow| in a delayed manner. |
| 138 void SetTaskRunnerForWaitingForTesting( | 138 void SetTaskRunnerForWaitingForTesting( |
| 139 const scoped_refptr<base::TaskRunner>& task_runner); | 139 const scoped_refptr<base::TaskRunner>& task_runner); |
| 140 | 140 |
| 141 // KeyedService: | 141 // KeyedService: |
| 142 virtual void Shutdown() override; | 142 void Shutdown() override; |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 class InputBuilder; | 145 class InputBuilder; |
| 146 struct EvaluationResults; | 146 struct EvaluationResults; |
| 147 | 147 |
| 148 enum State { | 148 enum State { |
| 149 STATE_UNINITIALIZED, | 149 STATE_UNINITIALIZED, |
| 150 STATE_INITIALIZED, | 150 STATE_INITIALIZED, |
| 151 STATE_DISABLED, | 151 STATE_DISABLED, |
| 152 STATE_WAITING_ON_DEPENDENCIES, | 152 STATE_WAITING_ON_DEPENDENCIES, |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 259 |
| 260 scoped_ptr<AutomaticProfileResetterDelegate> delegate_; | 260 scoped_ptr<AutomaticProfileResetterDelegate> delegate_; |
| 261 scoped_refptr<base::TaskRunner> task_runner_for_waiting_; | 261 scoped_refptr<base::TaskRunner> task_runner_for_waiting_; |
| 262 | 262 |
| 263 base::WeakPtrFactory<AutomaticProfileResetter> weak_ptr_factory_; | 263 base::WeakPtrFactory<AutomaticProfileResetter> weak_ptr_factory_; |
| 264 | 264 |
| 265 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetter); | 265 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetter); |
| 266 }; | 266 }; |
| 267 | 267 |
| 268 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_ | 268 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_H_ |
| OLD | NEW |