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

Side by Side Diff: chrome/browser/google_apis/auth_service_interface.h

Issue 96413002: Move c/b/google_apis to google_apis/drive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years 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
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_BROWSER_GOOGLE_APIS_AUTH_SERVICE_INTERFACE_H_
6 #define CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_INTERFACE_H_
7
8 #include <string>
9
10 #include "base/callback_forward.h"
11 #include "chrome/browser/google_apis/gdata_errorcode.h"
12
13 namespace google_apis {
14
15 class AuthServiceObserver;
16
17 // Called when fetching of access token is complete.
18 typedef base::Callback<void(GDataErrorCode error,
19 const std::string& access_token)>
20 AuthStatusCallback;
21
22 // This defines an interface for the authentication service which is required
23 // by authenticated requests (AuthenticatedRequestInterface).
24 // All functions must be called on UI thread.
25 class AuthServiceInterface {
26 public:
27 virtual ~AuthServiceInterface() {}
28
29 // Adds and removes the observer.
30 virtual void AddObserver(AuthServiceObserver* observer) = 0;
31 virtual void RemoveObserver(AuthServiceObserver* observer) = 0;
32
33 // Starts fetching OAuth2 access token from the refresh token.
34 // |callback| must not be null.
35 virtual void StartAuthentication(const AuthStatusCallback& callback) = 0;
36
37 // True if an OAuth2 access token is retrieved and believed to be fresh.
38 // The access token is used to access the Drive server.
39 virtual bool HasAccessToken() const = 0;
40
41 // True if an OAuth2 refresh token is present. Its absence means that user
42 // is not properly authenticated.
43 // The refresh token is used to get the access token.
44 virtual bool HasRefreshToken() const = 0;
45
46 // Returns OAuth2 access token.
47 virtual const std::string& access_token() const = 0;
48
49 // Clears OAuth2 access token.
50 virtual void ClearAccessToken() = 0;
51
52 // Clears OAuth2 refresh token.
53 virtual void ClearRefreshToken() = 0;
54 };
55
56 } // namespace google_apis
57
58 #endif // CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_INTERFACE_H_
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/auth_service.cc ('k') | chrome/browser/google_apis/auth_service_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698