| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Shows advanced configuration dialog without going through sign in dialog. | 52 // Shows advanced configuration dialog without going through sign in dialog. |
| 53 // Kicks the sync backend if necessary with showing spinner dialog until it | 53 // Kicks the sync backend if necessary with showing spinner dialog until it |
| 54 // gets ready. | 54 // gets ready. |
| 55 void OpenConfigureSync(); | 55 void OpenConfigureSync(); |
| 56 | 56 |
| 57 // Terminates the sync setup flow. | 57 // Terminates the sync setup flow. |
| 58 void CloseSyncSetup(); | 58 void CloseSyncSetup(); |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 friend class SyncSetupHandlerTest; | 61 friend class SyncSetupHandlerTest; |
| 62 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, DisplayBasicLogin); | |
| 63 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, | 62 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, |
| 64 DisplayConfigureWithBackendDisabledAndCancel); | 63 DisplayConfigureWithBackendDisabledAndCancel); |
| 65 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SelectCustomEncryption); | 64 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SelectCustomEncryption); |
| 66 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, ShowSyncSetupWhenNotSignedIn); | 65 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, ShowSyncSetupWhenNotSignedIn); |
| 67 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SuccessfullySetPassphrase); | 66 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SuccessfullySetPassphrase); |
| 68 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncEverything); | 67 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncEverything); |
| 69 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncNothing); | 68 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncNothing); |
| 70 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncAllManually); | 69 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncAllManually); |
| 71 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestPassphraseStillRequired); | 70 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestPassphraseStillRequired); |
| 72 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncIndividualTypes); | 71 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncIndividualTypes); |
| 73 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TurnOnEncryptAll); | 72 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TurnOnEncryptAll); |
| 74 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, UnsuccessfullySetPassphrase); | 73 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, UnsuccessfullySetPassphrase); |
| 75 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, | 74 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, |
| 76 UnrecoverableErrorInitializingSync); | 75 UnrecoverableErrorInitializingSync); |
| 77 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, | 76 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, |
| 78 GaiaErrorInitializingSync); | 77 GaiaErrorInitializingSync); |
| 79 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, HandleCaptcha); | 78 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, HandleCaptcha); |
| 80 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure); | 79 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, HandleGaiaAuthFailure); |
| 81 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, | 80 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerNonCrosTest, |
| 82 SubmitAuthWithInvalidUsername); | 81 SubmitAuthWithInvalidUsername); |
| 82 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin); |
| 83 | 83 |
| 84 bool is_configuring_sync() const { return configuring_sync_; } | 84 bool is_configuring_sync() const { return configuring_sync_; } |
| 85 | 85 |
| 86 // Display the configure sync UI. If |show_advanced| is true, skip directly | 86 // Display the configure sync UI. If |show_advanced| is true, skip directly |
| 87 // to the "advanced settings" dialog, otherwise give the user the simpler | 87 // to the "advanced settings" dialog, otherwise give the user the simpler |
| 88 // "Sync Everything" dialog. Overridden by subclasses to allow them to skip | 88 // "Sync Everything" dialog. Overridden by subclasses to allow them to skip |
| 89 // the sync setup dialog if desired. | 89 // the sync setup dialog if desired. |
| 90 // If |passphrase_failed| is true, then the user previously tried to enter an | 90 // If |passphrase_failed| is true, then the user previously tried to enter an |
| 91 // invalid passphrase. | 91 // invalid passphrase. |
| 92 virtual void DisplayConfigureSync(bool show_advanced, bool passphrase_failed); | 92 virtual void DisplayConfigureSync(bool show_advanced, bool passphrase_failed); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ProfileManager* const profile_manager_; | 159 ProfileManager* const profile_manager_; |
| 160 | 160 |
| 161 // The OneShotTimer object used to timeout of starting the sync backend | 161 // The OneShotTimer object used to timeout of starting the sync backend |
| 162 // service. | 162 // service. |
| 163 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | 163 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; |
| 164 | 164 |
| 165 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 165 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 168 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| OLD | NEW |