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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 void StartHost(const std::string& host_name, | 47 void StartHost(const std::string& host_name, |
48 const std::string& host_pin, | 48 const std::string& host_pin, |
49 bool consent_to_data_collection, | 49 bool consent_to_data_collection, |
50 const std::string& auth_code, | 50 const std::string& auth_code, |
51 const std::string& redirect_url, | 51 const std::string& redirect_url, |
52 CompletionCallback on_done); | 52 CompletionCallback on_done); |
53 | 53 |
54 // gaia::GaiaOAuthClient::Delegate | 54 // gaia::GaiaOAuthClient::Delegate |
55 virtual void OnGetTokensResponse(const std::string& refresh_token, | 55 virtual void OnGetTokensResponse(const std::string& refresh_token, |
56 const std::string& access_token, | 56 const std::string& access_token, |
57 int expires_in_seconds) OVERRIDE; | 57 int expires_in_seconds) override; |
58 virtual void OnRefreshTokenResponse(const std::string& access_token, | 58 virtual void OnRefreshTokenResponse(const std::string& access_token, |
59 int expires_in_seconds) OVERRIDE; | 59 int expires_in_seconds) override; |
60 virtual void OnGetUserEmailResponse(const std::string& user_email) OVERRIDE; | 60 virtual void OnGetUserEmailResponse(const std::string& user_email) override; |
61 | 61 |
62 // remoting::ServiceClient::Delegate | 62 // remoting::ServiceClient::Delegate |
63 virtual void OnHostRegistered(const std::string& authorization_code) OVERRIDE; | 63 virtual void OnHostRegistered(const std::string& authorization_code) override; |
64 virtual void OnHostUnregistered() OVERRIDE; | 64 virtual void OnHostUnregistered() override; |
65 | 65 |
66 // TODO(sergeyu): Following methods are members of all three delegate | 66 // TODO(sergeyu): Following methods are members of all three delegate |
67 // interfaces implemented in this class. Fix ServiceClient and | 67 // interfaces implemented in this class. Fix ServiceClient and |
68 // GaiaUserEmailFetcher so that Delegate interfaces do not overlap (ideally | 68 // GaiaUserEmailFetcher so that Delegate interfaces do not overlap (ideally |
69 // they should be changed to use Callback<>). | 69 // they should be changed to use Callback<>). |
70 virtual void OnOAuthError() OVERRIDE; | 70 virtual void OnOAuthError() override; |
71 virtual void OnNetworkError(int response_code) OVERRIDE; | 71 virtual void OnNetworkError(int response_code) override; |
72 | 72 |
73 private: | 73 private: |
74 HostStarter(scoped_ptr<gaia::GaiaOAuthClient> oauth_client, | 74 HostStarter(scoped_ptr<gaia::GaiaOAuthClient> oauth_client, |
75 scoped_ptr<remoting::ServiceClient> service_client, | 75 scoped_ptr<remoting::ServiceClient> service_client, |
76 scoped_refptr<remoting::DaemonController> daemon_controller); | 76 scoped_refptr<remoting::DaemonController> daemon_controller); |
77 | 77 |
78 void StartHostProcess(); | 78 void StartHostProcess(); |
79 | 79 |
80 void OnHostStarted(DaemonController::AsyncResult result); | 80 void OnHostStarted(DaemonController::AsyncResult result); |
81 | 81 |
(...skipping 21 matching lines...) Expand all Loading... |
103 | 103 |
104 base::WeakPtr<HostStarter> weak_ptr_; | 104 base::WeakPtr<HostStarter> weak_ptr_; |
105 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; | 105 base::WeakPtrFactory<HostStarter> weak_ptr_factory_; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(HostStarter); | 107 DISALLOW_COPY_AND_ASSIGN(HostStarter); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace remoting | 110 } // namespace remoting |
111 | 111 |
112 #endif // REMOTING_HOST_HOST_STARTER | 112 #endif // REMOTING_HOST_HOST_STARTER |
OLD | NEW |