| 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 CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 13 #include "chrome/browser/google_apis/auth_service_interface.h" | 13 #include "chrome/browser/google_apis/auth_service_interface.h" |
| 14 #include "chrome/browser/google_apis/base_operations.h" | |
| 15 #include "chrome/browser/google_apis/gdata_errorcode.h" | 14 #include "chrome/browser/google_apis/gdata_errorcode.h" |
| 16 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
| 18 | 17 |
| 19 class Profile; | 18 class Profile; |
| 20 | 19 |
| 21 namespace net { | 20 namespace net { |
| 22 class URLRequestContextGetter; | 21 class URLRequestContextGetter; |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 // |scopes| specifies OAuth2 scopes. | 39 // |scopes| specifies OAuth2 scopes. |
| 41 AuthService(net::URLRequestContextGetter* url_request_context_getter, | 40 AuthService(net::URLRequestContextGetter* url_request_context_getter, |
| 42 const std::vector<std::string>& scopes); | 41 const std::vector<std::string>& scopes); |
| 43 virtual ~AuthService(); | 42 virtual ~AuthService(); |
| 44 | 43 |
| 45 // Overriden from AuthServiceInterface: | 44 // Overriden from AuthServiceInterface: |
| 46 virtual void AddObserver(AuthServiceObserver* observer) OVERRIDE; | 45 virtual void AddObserver(AuthServiceObserver* observer) OVERRIDE; |
| 47 virtual void RemoveObserver(AuthServiceObserver* observer) OVERRIDE; | 46 virtual void RemoveObserver(AuthServiceObserver* observer) OVERRIDE; |
| 48 virtual void Initialize(Profile* profile) OVERRIDE; | 47 virtual void Initialize(Profile* profile) OVERRIDE; |
| 49 virtual void StartAuthentication(OperationRegistry* registry, | 48 virtual void StartAuthentication(OperationRegistry* registry, |
| 50 const AuthStatusCallback& callback) OVERRIDE; | 49 const AuthStatusCallback& callback) OVERRIDE; |
| 51 virtual bool HasAccessToken() const OVERRIDE; | 50 virtual bool HasAccessToken() const OVERRIDE; |
| 52 virtual bool HasRefreshToken() const OVERRIDE; | 51 virtual bool HasRefreshToken() const OVERRIDE; |
| 53 virtual const std::string& access_token() const OVERRIDE; | 52 virtual const std::string& access_token() const OVERRIDE; |
| 54 virtual void ClearAccessToken() OVERRIDE; | 53 virtual void ClearAccessToken() OVERRIDE; |
| 55 virtual void ClearRefreshToken() OVERRIDE; | 54 virtual void ClearRefreshToken() OVERRIDE; |
| 56 | 55 |
| 57 // Overridden from content::NotificationObserver: | 56 // Overridden from content::NotificationObserver: |
| 58 virtual void Observe(int type, | 57 virtual void Observe(int type, |
| 59 const content::NotificationSource& source, | 58 const content::NotificationSource& source, |
| 60 const content::NotificationDetails& details) OVERRIDE; | 59 const content::NotificationDetails& details) OVERRIDE; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 87 // Note: This should remain the last member so it'll be destroyed and | 86 // Note: This should remain the last member so it'll be destroyed and |
| 88 // invalidate its weak pointers before any other members are destroyed. | 87 // invalidate its weak pointers before any other members are destroyed. |
| 89 base::WeakPtrFactory<AuthService> weak_ptr_factory_; | 88 base::WeakPtrFactory<AuthService> weak_ptr_factory_; |
| 90 | 89 |
| 91 DISALLOW_COPY_AND_ASSIGN(AuthService); | 90 DISALLOW_COPY_AND_ASSIGN(AuthService); |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 } // namespace google_apis | 93 } // namespace google_apis |
| 95 | 94 |
| 96 #endif // CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ | 95 #endif // CHROME_BROWSER_GOOGLE_APIS_AUTH_SERVICE_H_ |
| OLD | NEW |