| 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 REMOTING_HOST_HOST_STARTER | 5 #ifndef REMOTING_HOST_HOST_STARTER |
| 6 #define REMOTING_HOST_HOST_STARTER | 6 #define REMOTING_HOST_HOST_STARTER |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 // gaia::GaiaOAuthClient::Delegate | 49 // gaia::GaiaOAuthClient::Delegate |
| 50 virtual void OnGetTokensResponse(const std::string& refresh_token, | 50 virtual void OnGetTokensResponse(const std::string& refresh_token, |
| 51 const std::string& access_token, | 51 const std::string& access_token, |
| 52 int expires_in_seconds) OVERRIDE; | 52 int expires_in_seconds) OVERRIDE; |
| 53 virtual void OnRefreshTokenResponse(const std::string& access_token, | 53 virtual void OnRefreshTokenResponse(const std::string& access_token, |
| 54 int expires_in_seconds) OVERRIDE; | 54 int expires_in_seconds) OVERRIDE; |
| 55 virtual void OnGetUserEmailResponse(const std::string& user_email) OVERRIDE; | 55 virtual void OnGetUserEmailResponse(const std::string& user_email) OVERRIDE; |
| 56 | 56 |
| 57 // remoting::ServiceClient::Delegate | 57 // remoting::ServiceClient::Delegate |
| 58 virtual void OnHostRegistered() OVERRIDE; | 58 virtual void OnHostRegistered(const std::string& authorization_code) OVERRIDE; |
| 59 virtual void OnHostUnregistered() OVERRIDE; | 59 virtual void OnHostUnregistered() OVERRIDE; |
| 60 | 60 |
| 61 // TODO(sergeyu): Following methods are members of all three delegate | 61 // TODO(sergeyu): Following methods are members of all three delegate |
| 62 // interfaces implemented in this class. Fix ServiceClient and | 62 // interfaces implemented in this class. Fix ServiceClient and |
| 63 // GaiaUserEmailFetcher so that Delegate interfaces do not overlap (ideally | 63 // GaiaUserEmailFetcher so that Delegate interfaces do not overlap (ideally |
| 64 // they should be changed to use Callback<>). | 64 // they should be changed to use Callback<>). |
| 65 virtual void OnOAuthError() OVERRIDE; | 65 virtual void OnOAuthError() OVERRIDE; |
| 66 virtual void OnNetworkError(int response_code) OVERRIDE; | 66 virtual void OnNetworkError(int response_code) OVERRIDE; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 HostStarter(scoped_ptr<gaia::GaiaOAuthClient> oauth_client, | 69 HostStarter(scoped_ptr<gaia::GaiaOAuthClient> oauth_client, |
| 70 scoped_ptr<remoting::ServiceClient> service_client, | 70 scoped_ptr<remoting::ServiceClient> service_client, |
| 71 scoped_ptr<remoting::DaemonController> daemon_controller); | 71 scoped_ptr<remoting::DaemonController> daemon_controller); |
| 72 | 72 |
| 73 void StartHostProcess(); |
| 74 |
| 73 void OnHostStarted(DaemonController::AsyncResult result); | 75 void OnHostStarted(DaemonController::AsyncResult result); |
| 74 | 76 |
| 75 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; | 77 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; |
| 76 scoped_ptr<remoting::ServiceClient> service_client_; | 78 scoped_ptr<remoting::ServiceClient> service_client_; |
| 77 scoped_ptr<remoting::DaemonController> daemon_controller_; | 79 scoped_ptr<remoting::DaemonController> daemon_controller_; |
| 78 gaia::OAuthClientInfo oauth_client_info_; | 80 gaia::OAuthClientInfo oauth_client_info_; |
| 79 std::string host_name_; | 81 std::string host_name_; |
| 80 std::string host_pin_; | 82 std::string host_pin_; |
| 81 bool consent_to_data_collection_; | 83 bool consent_to_data_collection_; |
| 82 CompletionCallback on_done_; | 84 CompletionCallback on_done_; |
| 83 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 85 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 84 std::string refresh_token_; | 86 std::string refresh_token_; |
| 85 std::string access_token_; | 87 std::string access_token_; |
| 86 std::string user_email_; | 88 std::string host_owner_; |
| 89 std::string xmpp_login_; |
| 87 scoped_refptr<remoting::RsaKeyPair> key_pair_; | 90 scoped_refptr<remoting::RsaKeyPair> key_pair_; |
| 88 std::string host_id_; | 91 std::string host_id_; |
| 92 bool use_service_account_; |
| 89 | 93 |
| 90 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; | 94 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; |
| 91 base::WeakPtr<HostStarter> weak_ptr_; | 95 base::WeakPtr<HostStarter> weak_ptr_; |
| 92 | 96 |
| 93 DISALLOW_COPY_AND_ASSIGN(HostStarter); | 97 DISALLOW_COPY_AND_ASSIGN(HostStarter); |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace remoting | 100 } // namespace remoting |
| 97 | 101 |
| 98 #endif // REMOTING_HOST_HOST_STARTER | 102 #endif // REMOTING_HOST_HOST_STARTER |
| OLD | NEW |