Chromium Code Reviews| 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_MERGE_SESSION_OBSERVER_BRIDGE_H_ | 5 #ifndef COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_ |
| 6 #define COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_ | 6 #define COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_ |
| 7 | 7 |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #import "base/ios/weak_nsobject.h" | |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "components/signin/core/browser/gaia_cookie_manager_service.h" | 14 #include "components/signin/core/browser/gaia_cookie_manager_service.h" |
| 14 | 15 |
| 15 class GoogleServiceAuthError; | 16 class GoogleServiceAuthError; |
| 16 | 17 |
| 17 @protocol MergeSessionObserverBridgeDelegate | 18 @protocol MergeSessionObserverBridgeDelegate |
| 18 | 19 |
| 19 // Informs the delegate that the merge session operation for |account_id| has | 20 // Informs the delegate that the merge session operation for |account_id| has |
| 20 // finished. If there was an error, it will be described in |error|. | 21 // finished. If there was an error, it will be described in |error|. |
| 21 - (void)onMergeSessionCompleted:(const std::string&)account_id | 22 - (void)onMergeSessionCompleted:(const std::string&)account_id |
| 22 error:(const GoogleServiceAuthError&)error; | 23 error:(const GoogleServiceAuthError&)error; |
| 23 | 24 |
| 24 @end | 25 @end |
| 25 | 26 |
| 26 // C++ class to monitor merge session status in Objective C type. | 27 // C++ class to monitor merge session status in Objective C type. |
| 27 class MergeSessionObserverBridge : public GaiaCookieManagerService::Observer { | 28 class MergeSessionObserverBridge : public GaiaCookieManagerService::Observer { |
| 28 public: | 29 public: |
| 29 MergeSessionObserverBridge(id<MergeSessionObserverBridgeDelegate> delegate, | 30 MergeSessionObserverBridge(id<MergeSessionObserverBridgeDelegate> delegate, |
| 30 GaiaCookieManagerService* cookie_manager_service); | 31 GaiaCookieManagerService* cookie_manager_service); |
| 31 ~MergeSessionObserverBridge() override; | 32 ~MergeSessionObserverBridge() override; |
| 32 | 33 |
| 33 void OnAddAccountToCookieCompleted( | 34 void OnAddAccountToCookieCompleted( |
| 34 const std::string& account_id, | 35 const std::string& account_id, |
| 35 const GoogleServiceAuthError& error) override; | 36 const GoogleServiceAuthError& error) override; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 id<MergeSessionObserverBridgeDelegate> delegate_; | 39 base::WeakNSProtocol<id<MergeSessionObserverBridgeDelegate>> delegate_; |
|
stkhapugin
2017/06/13 12:18:55
This seems to be included only from the correspond
msarda
2017/06/13 13:15:30
I do not know that much about ARC transition, so t
marq (ping after 24h)
2017/06/15 09:27:33
Because it's in a header, it can only be __weak if
| |
| 39 GaiaCookieManagerService* cookie_manager_service_; | 40 GaiaCookieManagerService* cookie_manager_service_; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(MergeSessionObserverBridge); | 42 DISALLOW_COPY_AND_ASSIGN(MergeSessionObserverBridge); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_ | 45 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_ |
| OLD | NEW |