OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ | 5 #ifndef CHROME_BROWSER_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ |
6 #define CHROME_BROWSER_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ | 6 #define CHROME_BROWSER_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ |
7 | 7 |
8 #include "chrome/browser/remoting/setup_flow.h" | 8 #include "chrome/browser/remoting/setup_flow.h" |
9 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 9 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
10 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" | 10 #include "chrome/common/net/gaia/gaia_auth_fetcher.h" |
11 | 11 |
12 namespace remoting { | 12 namespace remoting { |
13 | 13 |
14 // Implementation of login step for remoting setup flow. | 14 // Implementation of login step for remoting setup flow. |
15 class SetupFlowLoginStep : public SetupFlowStepBase, public GaiaAuthConsumer { | 15 class SetupFlowLoginStep : public SetupFlowStepBase, public GaiaAuthConsumer { |
16 public: | 16 public: |
17 SetupFlowLoginStep(); | 17 SetupFlowLoginStep(); |
| 18 SetupFlowLoginStep(const string16& error_message); |
18 virtual ~SetupFlowLoginStep(); | 19 virtual ~SetupFlowLoginStep(); |
19 | 20 |
20 // SetupFlowStep implementation. | 21 // SetupFlowStep implementation. |
21 virtual void HandleMessage(const std::string& message, const Value* arg); | 22 virtual void HandleMessage(const std::string& message, const Value* arg); |
22 virtual void Cancel(); | 23 virtual void Cancel(); |
23 | 24 |
24 // GaiaAuthConsumer implementation. | 25 // GaiaAuthConsumer implementation. |
25 virtual void OnClientLoginSuccess( | 26 virtual void OnClientLoginSuccess( |
26 const GaiaAuthConsumer::ClientLoginResult& credentials); | 27 const GaiaAuthConsumer::ClientLoginResult& credentials); |
27 virtual void OnClientLoginFailure(const GoogleServiceAuthError& error); | 28 virtual void OnClientLoginFailure(const GoogleServiceAuthError& error); |
28 virtual void OnIssueAuthTokenSuccess(const std::string& service, | 29 virtual void OnIssueAuthTokenSuccess(const std::string& service, |
29 const std::string& auth_token); | 30 const std::string& auth_token); |
30 virtual void OnIssueAuthTokenFailure(const std::string& service, | 31 virtual void OnIssueAuthTokenFailure(const std::string& service, |
31 const GoogleServiceAuthError& error); | 32 const GoogleServiceAuthError& error); |
32 | 33 |
33 protected: | 34 protected: |
34 virtual void DoStart(); | 35 virtual void DoStart(); |
35 | 36 |
36 private: | 37 private: |
37 void OnUserSubmittedAuth(const std::string& user, | 38 void OnUserSubmittedAuth(const std::string& user, |
38 const std::string& password, | 39 const std::string& password, |
39 const std::string& captcha); | 40 const std::string& captcha, |
| 41 const std::string& access_code); |
40 | 42 |
41 void ShowGaiaLogin(const DictionaryValue& args); | 43 void ShowGaiaLogin(const DictionaryValue& args); |
42 void ShowGaiaSuccessAndSettingUp(); | 44 void ShowGaiaSuccessAndSettingUp(); |
43 void ShowGaiaFailed(const GoogleServiceAuthError& error); | 45 void ShowGaiaFailed(const GoogleServiceAuthError& error); |
44 | 46 |
| 47 string16 error_message_; |
| 48 |
45 // Fetcher to obtain the Chromoting Directory token. | 49 // Fetcher to obtain the Chromoting Directory token. |
46 scoped_ptr<GaiaAuthFetcher> authenticator_; | 50 scoped_ptr<GaiaAuthFetcher> authenticator_; |
47 | 51 |
48 DISALLOW_COPY_AND_ASSIGN(SetupFlowLoginStep); | 52 DISALLOW_COPY_AND_ASSIGN(SetupFlowLoginStep); |
49 }; | 53 }; |
50 | 54 |
51 } // namespace remoting | 55 } // namespace remoting |
52 | 56 |
53 #endif // CHROME_BROWSER_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ | 57 #endif // CHROME_BROWSER_REMOTING_SETUP_FLOW_LOGIN_STEP_H_ |
OLD | NEW |