| 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 |
| 11 // easier to verify that the state machine inside AutomaticProfileResetter works | 11 // easier to verify that the state machine inside AutomaticProfileResetter works |
| 12 // correctly: by mocking out the interaction methods in the delegate, we can, in | 12 // correctly: by mocking out the interaction methods in the delegate, we can, in |
| 13 // effect, mock out the entire rest of the browser, allowing us to easily | 13 // effect, mock out the entire rest of the browser, allowing us to easily |
| 14 // simulate scenarios that are interesting for testing the state machine. | 14 // simulate scenarios that are interesting for testing the state machine. |
| 15 // | 15 // |
| 16 // The delegate is normally instantiated by AutomaticProfileResetter internally, | 16 // The delegate is normally instantiated by AutomaticProfileResetter internally, |
| 17 // while a mock implementation can be injected during unit tests. | 17 // while a mock implementation can be injected during unit tests. |
| 18 | 18 |
| 19 #ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H_ | 19 #ifndef CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H_ |
| 20 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H_ | 20 #define CHROME_BROWSER_PROFILE_RESETTER_AUTOMATIC_PROFILE_RESETTER_DELEGATE_H_ |
| 21 | 21 |
| 22 #include "base/basictypes.h" | 22 #include "base/basictypes.h" |
| 23 #include "base/callback_forward.h" | 23 #include "base/callback_forward.h" |
| 24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
| 25 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
| 26 #include "chrome/browser/profile_resetter/profile_resetter.h" | 26 #include "chrome/browser/profile_resetter/profile_resetter.h" |
| 27 #include "chrome/browser/search_engines/template_url_service_observer.h" | 27 #include "components/search_engines/template_url_service_observer.h" |
| 28 #include "content/public/browser/notification_observer.h" | 28 #include "content/public/browser/notification_observer.h" |
| 29 #include "content/public/browser/notification_registrar.h" | 29 #include "content/public/browser/notification_registrar.h" |
| 30 #include "extensions/common/one_shot_event.h" | 30 #include "extensions/common/one_shot_event.h" |
| 31 | 31 |
| 32 class BrandcodeConfigFetcher; | 32 class BrandcodeConfigFetcher; |
| 33 class GlobalErrorService; | 33 class GlobalErrorService; |
| 34 class Profile; | 34 class Profile; |
| 35 class ResettableSettingsSnapshot; | 35 class ResettableSettingsSnapshot; |
| 36 class TemplateURLService; | 36 class TemplateURLService; |
| 37 | 37 |
| (...skipping 192 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 |