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.h" | 10 #include "base/timer.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncEverything); | 76 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncEverything); |
77 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncAllManually); | 77 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncAllManually); |
78 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestPassphraseStillRequired); | 78 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestPassphraseStillRequired); |
79 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncIndividualTypes); | 79 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TestSyncIndividualTypes); |
80 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TurnOnEncryptAll); | 80 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, TurnOnEncryptAll); |
81 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, | 81 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, |
82 UnrecoverableErrorInitializingSync); | 82 UnrecoverableErrorInitializingSync); |
83 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, UnsuccessfullySetPassphrase); | 83 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, UnsuccessfullySetPassphrase); |
84 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername); | 84 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerTest, SubmitAuthWithInvalidUsername); |
85 | 85 |
| 86 bool is_configuring_sync() const { return configuring_sync_; } |
| 87 bool have_signin_tracker() const { return signin_tracker_; } |
86 | 88 |
87 // Subclasses must implement this to show the setup UI that's appropriate | 89 // Subclasses must implement this to show the setup UI that's appropriate |
88 // for the page this is contained in. | 90 // for the page this is contained in. |
89 virtual void ShowSetupUI() = 0; | 91 virtual void ShowSetupUI() = 0; |
90 | 92 |
91 // Overridden by subclasses (like SyncPromoHandler) to log stats about the | 93 // Overridden by subclasses (like SyncPromoHandler) to log stats about the |
92 // user's signin activity. | 94 // user's signin activity. |
93 virtual void RecordSignin(); | 95 virtual void RecordSignin(); |
94 | 96 |
95 // Display the configure sync UI. If |show_advanced| is true, skip directly | 97 // Display the configure sync UI. If |show_advanced| is true, skip directly |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Shows the GAIA login success page then exits. | 134 // Shows the GAIA login success page then exits. |
133 void DisplayGaiaSuccessAndClose(); | 135 void DisplayGaiaSuccessAndClose(); |
134 | 136 |
135 // Displays the GAIA login success page then transitions to sync setup. | 137 // Displays the GAIA login success page then transitions to sync setup. |
136 void DisplayGaiaSuccessAndSettingUp(); | 138 void DisplayGaiaSuccessAndSettingUp(); |
137 | 139 |
138 // Displays the GAIA login form. If |fatal_error| is true, displays the fatal | 140 // Displays the GAIA login form. If |fatal_error| is true, displays the fatal |
139 // error UI. | 141 // error UI. |
140 void DisplayGaiaLogin(bool fatal_error); | 142 void DisplayGaiaLogin(bool fatal_error); |
141 | 143 |
| 144 // When web-flow is enabled, displays the Gaia login form in a new tab. |
| 145 // This function is virtual so that tests can override. |
| 146 virtual void DisplayGaiaLoginInNewTab(); |
| 147 |
142 // Displays the GAIA login form with a custom error message (used for errors | 148 // Displays the GAIA login form with a custom error message (used for errors |
143 // like "email address already in use by another profile"). No message | 149 // like "email address already in use by another profile"). No message |
144 // displayed if |error_message| is empty. Displays fatal error UI if | 150 // displayed if |error_message| is empty. Displays fatal error UI if |
145 // |fatal_error| = true. | 151 // |fatal_error| = true. |
146 void DisplayGaiaLoginWithErrorMessage(const string16& error_message, | 152 void DisplayGaiaLoginWithErrorMessage(const string16& error_message, |
147 bool fatal_error); | 153 bool fatal_error); |
148 | 154 |
149 // A utility function to call before actually showing setup dialog. Makes sure | 155 // A utility function to call before actually showing setup dialog. Makes sure |
150 // that a new dialog can be shown and sets flag that setup is in progress. | 156 // that a new dialog can be shown and sets flag that setup is in progress. |
151 bool PrepareSyncSetup(); | 157 bool PrepareSyncSetup(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | 222 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; |
217 | 223 |
218 // When using web-flow, weak pointer to the tab that holds the Gaia sign in | 224 // When using web-flow, weak pointer to the tab that holds the Gaia sign in |
219 // page. | 225 // page. |
220 content::WebContents* active_gaia_signin_tab_; | 226 content::WebContents* active_gaia_signin_tab_; |
221 | 227 |
222 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 228 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
223 }; | 229 }; |
224 | 230 |
225 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 231 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |