Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: chrome/common/net/gaia/gaia_auth_consumer.h

Issue 10928017: Moving google_apis and GaiaClient to src/google_apis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/net/gaia/DEPS ('k') | chrome/common/net/gaia/gaia_auth_consumer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_
6 #define CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_
7
8 #include <string>
9 #include <map>
10 #include <vector>
11
12 class GoogleServiceAuthError;
13
14 namespace net {
15 typedef std::vector<std::string> ResponseCookies;
16 }
17
18 typedef std::map<std::string, std::string> UserInfoMap;
19
20 // An interface that defines the callbacks for objects that
21 // GaiaAuthFetcher can return data to.
22 class GaiaAuthConsumer {
23 public:
24 struct ClientLoginResult {
25 ClientLoginResult();
26 ClientLoginResult(const std::string& new_sid,
27 const std::string& new_lsid,
28 const std::string& new_token,
29 const std::string& new_data);
30 ~ClientLoginResult();
31
32 bool operator==(const ClientLoginResult &b) const;
33
34 std::string sid;
35 std::string lsid;
36 std::string token;
37 // TODO(chron): Remove the data field later. Don't use it if possible.
38 std::string data; // Full contents of ClientLogin return.
39 bool two_factor; // set to true if there was a TWO_FACTOR "failure".
40 };
41
42 struct ClientOAuthResult {
43 ClientOAuthResult();
44 ClientOAuthResult(const std::string& new_refresh_token,
45 const std::string& new_access_token,
46 int new_expires_in_secs);
47 ~ClientOAuthResult();
48
49 bool operator==(const ClientOAuthResult &b) const;
50
51 // OAuth2 refresh token. Used to mint new access tokens when needed.
52 std::string refresh_token;
53
54 // OAuth2 access token. Token to pass to endpoints that require oauth2
55 // authentication.
56 std::string access_token;
57
58 // The lifespan of |access_token| in seconds.
59 int expires_in_secs;
60 };
61
62 virtual ~GaiaAuthConsumer() {}
63
64 virtual void OnClientLoginSuccess(const ClientLoginResult& result) {}
65 virtual void OnClientLoginFailure(const GoogleServiceAuthError& error) {}
66
67 virtual void OnIssueAuthTokenSuccess(const std::string& service,
68 const std::string& auth_token) {}
69 virtual void OnIssueAuthTokenFailure(const std::string& service,
70 const GoogleServiceAuthError& error) {}
71
72 virtual void OnClientOAuthSuccess(const ClientOAuthResult& result) {}
73 virtual void OnClientOAuthFailure(const GoogleServiceAuthError& error) {}
74
75 virtual void OnGetUserInfoSuccess(const UserInfoMap& data) {}
76 virtual void OnGetUserInfoFailure(const GoogleServiceAuthError& error) {}
77
78 virtual void OnUberAuthTokenSuccess(const std::string& token) {}
79 virtual void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) {}
80
81 virtual void OnMergeSessionSuccess(const std::string& data) {}
82 virtual void OnMergeSessionFailure(const GoogleServiceAuthError& error) {}
83 };
84
85 #endif // CHROME_COMMON_NET_GAIA_GAIA_AUTH_CONSUMER_H_
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/DEPS ('k') | chrome/common/net/gaia/gaia_auth_consumer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698