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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_
6 #define COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_
8 #import <Foundation/Foundation.h>
12 #include "base/macros.h"
13 #include "google_apis/gaia/merge_session_helper.h"
15 class AccountReconcilor
;
16 class GoogleServiceAuthError
;
18 @protocol MergeSessionObserverBridgeDelegate
20 // Informs the delegate that the merge session operation for |account_id| has
21 // finished. If there was an error, it will be described in |error|.
22 - (void)onMergeSessionCompleted
:(const std::string
&)account_id
23 error
:(const GoogleServiceAuthError
&)error
;
27 // C++ class to monitor merge session status in Objective C type.
28 class MergeSessionObserverBridge
: public MergeSessionHelper::Observer
{
30 MergeSessionObserverBridge(id
<MergeSessionObserverBridgeDelegate
> delegate
,
31 AccountReconcilor
* account_reconcilor
);
32 ~MergeSessionObserverBridge() override
;
34 void MergeSessionCompleted(const std::string
& account_id
,
35 const GoogleServiceAuthError
& error
) override
;
38 id
<MergeSessionObserverBridgeDelegate
> delegate_
;
39 AccountReconcilor
* account_reconcilor_
;
41 DISALLOW_COPY_AND_ASSIGN(MergeSessionObserverBridge
);
44 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_