| 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 // Declares a delegate that interacts with the rest of the browser on behalf of | 5 // Declares a delegate that interacts with the rest of the browser on behalf of |
| 6 // the AutomaticProfileResetter. | 6 // the AutomaticProfileResetter. |
| 7 // | 7 // |
| 8 // The reason for this separation is to facilitate unit testing. Factoring out | 8 // The reason for this separation is to facilitate unit testing. Factoring out |
| 9 // the implementation for each interaction step (encapsulated by one method of | 9 // the implementation for each interaction step (encapsulated by one method of |
| 10 // the delegate) allows it to be tested independently in itself. It also becomes | 10 // the delegate) allows it to be tested independently in itself. It also becomes |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 virtual ~AutomaticProfileResetterDelegateImpl(); | 127 virtual ~AutomaticProfileResetterDelegateImpl(); |
| 128 | 128 |
| 129 // Returns the brandcoded default settings; empty defaults if this is not a | 129 // Returns the brandcoded default settings; empty defaults if this is not a |
| 130 // branded build; or NULL if FetchBrandcodedDefaultSettingsIfNeeded() has not | 130 // branded build; or NULL if FetchBrandcodedDefaultSettingsIfNeeded() has not |
| 131 // yet been called or not yet finished. Exposed only for unit tests. | 131 // yet been called or not yet finished. Exposed only for unit tests. |
| 132 const BrandcodedDefaultSettings* brandcoded_defaults() const { | 132 const BrandcodedDefaultSettings* brandcoded_defaults() const { |
| 133 return brandcoded_defaults_.get(); | 133 return brandcoded_defaults_.get(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 // AutomaticProfileResetterDelegate: | 136 // AutomaticProfileResetterDelegate: |
| 137 virtual void EnumerateLoadedModulesIfNeeded() OVERRIDE; | 137 virtual void EnumerateLoadedModulesIfNeeded() override; |
| 138 virtual void RequestCallbackWhenLoadedModulesAreEnumerated( | 138 virtual void RequestCallbackWhenLoadedModulesAreEnumerated( |
| 139 const base::Closure& ready_callback) const OVERRIDE; | 139 const base::Closure& ready_callback) const override; |
| 140 virtual void LoadTemplateURLServiceIfNeeded() OVERRIDE; | 140 virtual void LoadTemplateURLServiceIfNeeded() override; |
| 141 virtual void RequestCallbackWhenTemplateURLServiceIsLoaded( | 141 virtual void RequestCallbackWhenTemplateURLServiceIsLoaded( |
| 142 const base::Closure& ready_callback) const OVERRIDE; | 142 const base::Closure& ready_callback) const override; |
| 143 virtual void FetchBrandcodedDefaultSettingsIfNeeded() OVERRIDE; | 143 virtual void FetchBrandcodedDefaultSettingsIfNeeded() override; |
| 144 virtual void RequestCallbackWhenBrandcodedDefaultsAreFetched( | 144 virtual void RequestCallbackWhenBrandcodedDefaultsAreFetched( |
| 145 const base::Closure& ready_callback) const OVERRIDE; | 145 const base::Closure& ready_callback) const override; |
| 146 virtual scoped_ptr<base::ListValue> | 146 virtual scoped_ptr<base::ListValue> |
| 147 GetLoadedModuleNameDigests() const OVERRIDE; | 147 GetLoadedModuleNameDigests() const override; |
| 148 virtual scoped_ptr<base::DictionaryValue> | 148 virtual scoped_ptr<base::DictionaryValue> |
| 149 GetDefaultSearchProviderDetails() const OVERRIDE; | 149 GetDefaultSearchProviderDetails() const override; |
| 150 virtual bool IsDefaultSearchProviderManaged() const OVERRIDE; | 150 virtual bool IsDefaultSearchProviderManaged() const override; |
| 151 virtual scoped_ptr<base::ListValue> | 151 virtual scoped_ptr<base::ListValue> |
| 152 GetPrepopulatedSearchProvidersDetails() const OVERRIDE; | 152 GetPrepopulatedSearchProvidersDetails() const override; |
| 153 virtual bool TriggerPrompt() OVERRIDE; | 153 virtual bool TriggerPrompt() override; |
| 154 virtual void TriggerProfileSettingsReset( | 154 virtual void TriggerProfileSettingsReset( |
| 155 bool send_feedback, | 155 bool send_feedback, |
| 156 const base::Closure& completion) OVERRIDE; | 156 const base::Closure& completion) override; |
| 157 virtual void DismissPrompt() OVERRIDE; | 157 virtual void DismissPrompt() override; |
| 158 | 158 |
| 159 // TemplateURLServiceObserver: | 159 // TemplateURLServiceObserver: |
| 160 virtual void OnTemplateURLServiceChanged() OVERRIDE; | 160 virtual void OnTemplateURLServiceChanged() override; |
| 161 | 161 |
| 162 // content::NotificationObserver: | 162 // content::NotificationObserver: |
| 163 virtual void Observe(int type, | 163 virtual void Observe(int type, |
| 164 const content::NotificationSource& source, | 164 const content::NotificationSource& source, |
| 165 const content::NotificationDetails& details) OVERRIDE; | 165 const content::NotificationDetails& details) override; |
| 166 | 166 |
| 167 private: | 167 private: |
| 168 // Sends a feedback |report|, where |report| is supposed to be result of | 168 // Sends a feedback |report|, where |report| is supposed to be result of |
| 169 // ::SerializeSettingsReport(). Virtual, so it can be mocked out for tests. | 169 // ::SerializeSettingsReport(). Virtual, so it can be mocked out for tests. |
| 170 virtual void SendFeedback(const std::string& report) const; | 170 virtual void SendFeedback(const std::string& report) const; |
| 171 | 171 |
| 172 // Triggers the ProfileResetter to reset |resettable_aspects_| and optionally | 172 // Triggers the ProfileResetter to reset |resettable_aspects_| and optionally |
| 173 // |send_feedback|. Will invoke |completion| on the UI thread once completed | 173 // |send_feedback|. Will invoke |completion| on the UI thread once completed |
| 174 // The |brandcoded_defaults_| must already be initialized when this is called. | 174 // The |brandcoded_defaults_| must already be initialized when this is called. |
| 175 void RunProfileSettingsReset(bool send_feedback, | 175 void RunProfileSettingsReset(bool send_feedback, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 extensions::OneShotEvent template_url_service_ready_event_; | 230 extensions::OneShotEvent template_url_service_ready_event_; |
| 231 | 231 |
| 232 // This event is signaled once brandcoded default settings have been fetched, | 232 // This event is signaled once brandcoded default settings have been fetched, |
| 233 // or once it has been established that this is not a branded build. | 233 // or once it has been established that this is not a branded build. |
| 234 extensions::OneShotEvent brandcoded_defaults_fetched_event_; | 234 extensions::OneShotEvent brandcoded_defaults_fetched_event_; |
| 235 | 235 |
| 236 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterDelegateImpl); | 236 DISALLOW_COPY_AND_ASSIGN(AutomaticProfileResetterDelegateImpl); |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H
_ | 239 #endif // CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H
_ |
| OLD | NEW |