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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // invalid passphrase. | 90 // invalid passphrase. |
91 virtual void DisplayConfigureSync(bool show_advanced, bool passphrase_failed); | 91 virtual void DisplayConfigureSync(bool show_advanced, bool passphrase_failed); |
92 | 92 |
93 // Called when configuring sync is done to close the dialog and start syncing. | 93 // Called when configuring sync is done to close the dialog and start syncing. |
94 void ConfigureSyncDone(); | 94 void ConfigureSyncDone(); |
95 | 95 |
96 // Helper routine that gets the ProfileSyncService associated with the parent | 96 // Helper routine that gets the ProfileSyncService associated with the parent |
97 // profile. | 97 // profile. |
98 ProfileSyncService* GetSyncService() const; | 98 ProfileSyncService* GetSyncService() const; |
99 | 99 |
| 100 // Returns the LoginUIService for the parent profile. |
| 101 LoginUIService* GetLoginUIService() const; |
| 102 |
100 private: | 103 private: |
101 // Callbacks from the page. | 104 // Callbacks from the page. |
102 void OnDidClosePage(const base::ListValue* args); | 105 void OnDidClosePage(const base::ListValue* args); |
103 void HandleSubmitAuth(const base::ListValue* args); | 106 void HandleSubmitAuth(const base::ListValue* args); |
104 void HandleConfigure(const base::ListValue* args); | 107 void HandleConfigure(const base::ListValue* args); |
105 void HandlePassphraseEntry(const base::ListValue* args); | 108 void HandlePassphraseEntry(const base::ListValue* args); |
106 void HandlePassphraseCancel(const base::ListValue* args); | 109 void HandlePassphraseCancel(const base::ListValue* args); |
107 void HandleAttachHandler(const base::ListValue* args); | 110 void HandleAttachHandler(const base::ListValue* args); |
108 void HandleShowErrorUI(const base::ListValue* args); | 111 void HandleShowErrorUI(const base::ListValue* args); |
109 void HandleShowSetupUI(const base::ListValue* args); | 112 void HandleShowSetupUI(const base::ListValue* args); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 166 |
164 // Returns true if the given login data is valid, false otherwise. If the | 167 // Returns true if the given login data is valid, false otherwise. If the |
165 // login data is not valid then on return |error_message| will be set to a | 168 // login data is not valid then on return |error_message| will be set to a |
166 // localized error message. Note, |error_message| must not be NULL. | 169 // localized error message. Note, |error_message| must not be NULL. |
167 bool IsLoginAuthDataValid(const std::string& username, | 170 bool IsLoginAuthDataValid(const std::string& username, |
168 string16* error_message); | 171 string16* error_message); |
169 | 172 |
170 // Returns the SigninManager for the parent profile. | 173 // Returns the SigninManager for the parent profile. |
171 SigninManager* GetSignin() const; | 174 SigninManager* GetSignin() const; |
172 | 175 |
173 // Returns the LoginUIService for the parent profile. | |
174 LoginUIService* GetLoginUIService() const; | |
175 | |
176 // The SigninTracker object used to determine when the user has fully signed | 176 // The SigninTracker object used to determine when the user has fully signed |
177 // in (this requires waiting for various services to initialize and tracking | 177 // in (this requires waiting for various services to initialize and tracking |
178 // errors from multiple sources). Should only be non-null while the login UI | 178 // errors from multiple sources). Should only be non-null while the login UI |
179 // is visible. | 179 // is visible. |
180 scoped_ptr<SigninTracker> signin_tracker_; | 180 scoped_ptr<SigninTracker> signin_tracker_; |
181 | 181 |
182 // Set to true whenever the sync configure UI is visible. This is used to tell | 182 // Set to true whenever the sync configure UI is visible. This is used to tell |
183 // what stage of the setup wizard the user was in and to update the UMA | 183 // what stage of the setup wizard the user was in and to update the UMA |
184 // histograms in the case that the user cancels out. | 184 // histograms in the case that the user cancels out. |
185 bool configuring_sync_; | 185 bool configuring_sync_; |
(...skipping 12 matching lines...) Expand all Loading... |
198 bool retry_on_signin_failure_; | 198 bool retry_on_signin_failure_; |
199 | 199 |
200 // The OneShotTimer object used to timeout of starting the sync backend | 200 // The OneShotTimer object used to timeout of starting the sync backend |
201 // service. | 201 // service. |
202 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | 202 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; |
203 | 203 |
204 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 204 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
205 }; | 205 }; |
206 | 206 |
207 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 207 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |