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 "chrome/browser/signin/signin_tracker.h" | 10 #include "chrome/browser/signin/signin_tracker.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 private: | 92 private: |
93 // Callbacks from the page. | 93 // Callbacks from the page. |
94 void OnDidClosePage(const base::ListValue* args); | 94 void OnDidClosePage(const base::ListValue* args); |
95 void HandleSubmitAuth(const base::ListValue* args); | 95 void HandleSubmitAuth(const base::ListValue* args); |
96 void HandleConfigure(const base::ListValue* args); | 96 void HandleConfigure(const base::ListValue* args); |
97 void HandlePassphraseEntry(const base::ListValue* args); | 97 void HandlePassphraseEntry(const base::ListValue* args); |
98 void HandlePassphraseCancel(const base::ListValue* args); | 98 void HandlePassphraseCancel(const base::ListValue* args); |
99 void HandleAttachHandler(const base::ListValue* args); | 99 void HandleAttachHandler(const base::ListValue* args); |
100 void HandleShowErrorUI(const base::ListValue* args); | 100 void HandleShowErrorUI(const base::ListValue* args); |
101 void HandleShowSetupUI(const base::ListValue* args); | 101 void HandleShowSetupUI(const base::ListValue* args); |
| 102 void HandleStopSyncing(const base::ListValue* args); |
102 | 103 |
103 // Helper routine that gets the Profile associated with this object (virtual | 104 // Helper routine that gets the Profile associated with this object (virtual |
104 // so tests can override). | 105 // so tests can override). |
105 virtual Profile* GetProfile() const; | 106 virtual Profile* GetProfile() const; |
106 | 107 |
107 // Shows the GAIA login success page then exits. | 108 // Shows the GAIA login success page then exits. |
108 void DisplayGaiaSuccessAndClose(); | 109 void DisplayGaiaSuccessAndClose(); |
109 | 110 |
110 // Displays the GAIA login success page then transitions to sync setup. | 111 // Displays the GAIA login success page then transitions to sync setup. |
111 void DisplayGaiaSuccessAndSettingUp(); | 112 void DisplayGaiaSuccessAndSettingUp(); |
112 | 113 |
113 // Displays the GAIA login form. If |fatal_error| is true, displays the fatal | 114 // Displays the GAIA login form. If |fatal_error| is true, displays the fatal |
114 // error UI. | 115 // error UI. |
115 void DisplayGaiaLogin(bool fatal_error); | 116 void DisplayGaiaLogin(bool fatal_error); |
116 | 117 |
117 // Displays the GAIA login form with a custom error message (used for errors | 118 // Displays the GAIA login form with a custom error message (used for errors |
118 // like "email address already in use by another profile"). No message | 119 // like "email address already in use by another profile"). No message |
119 // displayed if |error_message| is empty. Displays fatal error UI if | 120 // displayed if |error_message| is empty. Displays fatal error UI if |
120 // |fatal_error| = true. | 121 // |fatal_error| = true. |
121 void DisplayGaiaLoginWithErrorMessage(const string16& error_message, | 122 void DisplayGaiaLoginWithErrorMessage(const string16& error_message, |
122 bool fatal_error); | 123 bool fatal_error); |
123 | 124 |
124 // Instead of siging in, prepare requirements for showing the advanced | 125 // Instead of signing in, prepare requirements for showing the advanced |
125 // configuration dialog. | 126 // configuration dialog. |
126 void PrepareConfigDialog(); | 127 void PrepareConfigDialog(); |
127 | 128 |
128 // Displays spinner-only UI indicating that something is going on in the | 129 // Displays spinner-only UI indicating that something is going on in the |
129 // background. | 130 // background. |
130 // TODO(kochi): better to show some message that the user can understand what | 131 // TODO(kochi): better to show some message that the user can understand what |
131 // is running in the background. | 132 // is running in the background. |
132 void DisplaySpinner(); | 133 void DisplaySpinner(); |
133 | 134 |
134 // Returns true if we're the active login object. | 135 // Returns true if we're the active login object. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Cache of the last name the client attempted to authenticate. | 176 // Cache of the last name the client attempted to authenticate. |
176 std::string last_attempted_user_email_; | 177 std::string last_attempted_user_email_; |
177 | 178 |
178 // The error from the last signin attempt. | 179 // The error from the last signin attempt. |
179 GoogleServiceAuthError last_signin_error_; | 180 GoogleServiceAuthError last_signin_error_; |
180 | 181 |
181 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 182 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
182 }; | 183 }; |
183 | 184 |
184 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 185 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |