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_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ | 5 #ifndef CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ |
6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ | 6 #define CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 void AuthenticateWithRobotToken(const std::string& robot_oauth_refresh_token, | 60 void AuthenticateWithRobotToken(const std::string& robot_oauth_refresh_token, |
61 const std::string& robot_email); | 61 const std::string& robot_email); |
62 void AuthenticateWithRobotAuthCode(const std::string& robot_oauth_auth_code, | 62 void AuthenticateWithRobotAuthCode(const std::string& robot_oauth_auth_code, |
63 const std::string& robot_email); | 63 const std::string& robot_email); |
64 | 64 |
65 void RefreshAccessToken(); | 65 void RefreshAccessToken(); |
66 | 66 |
67 // gaia::GaiaOAuthClient::Delegate implementation. | 67 // gaia::GaiaOAuthClient::Delegate implementation. |
68 virtual void OnGetTokensResponse(const std::string& refresh_token, | 68 virtual void OnGetTokensResponse(const std::string& refresh_token, |
69 const std::string& access_token, | 69 const std::string& access_token, |
70 int expires_in_seconds); | 70 int expires_in_seconds) OVERRIDE; |
71 virtual void OnRefreshTokenResponse(const std::string& access_token, | 71 virtual void OnRefreshTokenResponse(const std::string& access_token, |
72 int expires_in_seconds); | 72 int expires_in_seconds) OVERRIDE; |
73 virtual void OnOAuthError(); | 73 virtual void OnOAuthError() OVERRIDE; |
74 virtual void OnNetworkError(int response_code); | 74 virtual void OnNetworkError(int response_code) OVERRIDE; |
75 | 75 |
76 // CloudPrintURLFetcher::Delegate implementation. | 76 // CloudPrintURLFetcher::Delegate implementation. |
77 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( | 77 virtual CloudPrintURLFetcher::ResponseAction HandleJSONData( |
78 const content::URLFetcher* source, | 78 const content::URLFetcher* source, |
79 const GURL& url, | 79 const GURL& url, |
80 base::DictionaryValue* json_data, | 80 base::DictionaryValue* json_data, |
81 bool succeeded); | 81 bool succeeded) OVERRIDE; |
82 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError(); | 82 virtual CloudPrintURLFetcher::ResponseAction OnRequestAuthError() OVERRIDE; |
83 virtual std::string GetAuthHeader(); | 83 virtual std::string GetAuthHeader() OVERRIDE; |
84 | 84 |
85 private: | 85 private: |
86 Client* client_; | 86 Client* client_; |
87 gaia::OAuthClientInfo oauth_client_info_; | 87 gaia::OAuthClientInfo oauth_client_info_; |
88 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; | 88 scoped_ptr<gaia::GaiaOAuthClient> oauth_client_; |
89 scoped_ptr<DictionaryValue> print_system_settings_; | 89 scoped_ptr<DictionaryValue> print_system_settings_; |
90 | 90 |
91 // The CloudPrintURLFetcher instance for the current request. | 91 // The CloudPrintURLFetcher instance for the current request. |
92 scoped_refptr<CloudPrintURLFetcher> request_; | 92 scoped_refptr<CloudPrintURLFetcher> request_; |
93 | 93 |
(...skipping 11 matching lines...) Expand all Loading... |
105 std::string robot_email_; | 105 std::string robot_email_; |
106 // client login token used to authenticate request to cloud print server to | 106 // client login token used to authenticate request to cloud print server to |
107 // get the robot account. | 107 // get the robot account. |
108 std::string client_login_token_; | 108 std::string client_login_token_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(CloudPrintAuth); | 110 DISALLOW_COPY_AND_ASSIGN(CloudPrintAuth); |
111 }; | 111 }; |
112 | 112 |
113 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ | 113 #endif // CHROME_SERVICE_CLOUD_PRINT_CLOUD_PRINT_AUTH_H_ |
114 | 114 |
OLD | NEW |