OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SETUP_GAIA_OAUTH_CLIENT_H_ | 5 #ifndef REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |
6 #define REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ | 6 #define REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 | 53 |
54 void OnOAuthError() override; | 54 void OnOAuthError() override; |
55 void OnNetworkError(int response_code) override; | 55 void OnNetworkError(int response_code) override; |
56 | 56 |
57 private: | 57 private: |
58 struct Request { | 58 struct Request { |
59 Request(const gaia::OAuthClientInfo& oauth_client_info, | 59 Request(const gaia::OAuthClientInfo& oauth_client_info, |
60 const std::string& auth_code, | 60 const std::string& auth_code, |
61 bool need_user_email, | 61 bool need_user_email, |
62 CompletionCallback on_done); | 62 CompletionCallback on_done); |
| 63 Request(const Request& other); |
63 virtual ~Request(); | 64 virtual ~Request(); |
64 gaia::OAuthClientInfo oauth_client_info; | 65 gaia::OAuthClientInfo oauth_client_info; |
65 std::string auth_code; | 66 std::string auth_code; |
66 bool need_user_email; | 67 bool need_user_email; |
67 CompletionCallback on_done; | 68 CompletionCallback on_done; |
68 }; | 69 }; |
69 | 70 |
70 void SendResponse(const std::string& user_email, | 71 void SendResponse(const std::string& user_email, |
71 const std::string& refresh_token); | 72 const std::string& refresh_token); |
72 | 73 |
73 std::queue<Request> pending_requests_; | 74 std::queue<Request> pending_requests_; |
74 gaia::GaiaOAuthClient gaia_oauth_client_; | 75 gaia::GaiaOAuthClient gaia_oauth_client_; |
75 std::string refresh_token_; | 76 std::string refresh_token_; |
76 bool need_user_email_; | 77 bool need_user_email_; |
77 CompletionCallback on_done_; | 78 CompletionCallback on_done_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(GaiaOAuthClient); | 80 DISALLOW_COPY_AND_ASSIGN(GaiaOAuthClient); |
80 }; | 81 }; |
81 | 82 |
82 } // namespace remoting | 83 } // namespace remoting |
83 | 84 |
84 #endif // REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ | 85 #endif // REMOTING_HOST_SETUP_GAIA_OAUTH_CLIENT_H_ |
OLD | NEW |