OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ | 5 #ifndef COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ |
6 #define COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ | 6 #define COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
| 10 #import "base/ios/weak_nsobject.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "google_apis/gaia/oauth2_token_service.h" | 12 #include "google_apis/gaia/oauth2_token_service.h" |
12 | 13 |
13 @protocol OAuth2TokenServiceObserverBridgeDelegate <NSObject> | 14 @protocol OAuth2TokenServiceObserverBridgeDelegate <NSObject> |
14 | 15 |
15 @optional | 16 @optional |
16 | 17 |
17 // Informs the delegate that a refresh token is avaible for |account_id|. | 18 // Informs the delegate that a refresh token is avaible for |account_id|. |
18 - (void)onRefreshTokenAvailable:(const std::string&)account_id; | 19 - (void)onRefreshTokenAvailable:(const std::string&)account_id; |
19 | 20 |
(...skipping 22 matching lines...) Expand all Loading... |
42 | 43 |
43 // OAuth2TokenService::Observer | 44 // OAuth2TokenService::Observer |
44 void OnRefreshTokenAvailable(const std::string& account_id) override; | 45 void OnRefreshTokenAvailable(const std::string& account_id) override; |
45 void OnRefreshTokenRevoked(const std::string& account_id) override; | 46 void OnRefreshTokenRevoked(const std::string& account_id) override; |
46 void OnRefreshTokensLoaded() override; | 47 void OnRefreshTokensLoaded() override; |
47 void OnStartBatchChanges() override; | 48 void OnStartBatchChanges() override; |
48 void OnEndBatchChanges() override; | 49 void OnEndBatchChanges() override; |
49 | 50 |
50 private: | 51 private: |
51 OAuth2TokenService* token_service_; // weak | 52 OAuth2TokenService* token_service_; // weak |
52 id<OAuth2TokenServiceObserverBridgeDelegate> delegate_; | 53 base::WeakNSProtocol<id<OAuth2TokenServiceObserverBridgeDelegate>> delegate_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(OAuth2TokenServiceObserverBridge); | 55 DISALLOW_COPY_AND_ASSIGN(OAuth2TokenServiceObserverBridge); |
55 }; | 56 }; |
56 | 57 |
57 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ | 58 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_OAUTH2_TOKEN_SERVICE_OBSERVER_BRIDGE_H_ |
OLD | NEW |