Roll src/third_party/WebKit 9f7fb92:f103b33 (svn 202621:202622)
[chromium-blink-merge.git] / components / signin / ios / browser / merge_session_observer_bridge.h
blob8137dbbf1d0532e01b0bf04b595c977a3f1a044f
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>
10 #include <string>
12 #include "base/macros.h"
13 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
15 class GoogleServiceAuthError;
17 @protocol MergeSessionObserverBridgeDelegate
19 // 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 - (void)onMergeSessionCompleted:(const std::string&)account_id
22 error:(const GoogleServiceAuthError&)error;
24 @end
26 // C++ class to monitor merge session status in Objective C type.
27 class MergeSessionObserverBridge : public GaiaCookieManagerService::Observer {
28 public:
29 MergeSessionObserverBridge(id<MergeSessionObserverBridgeDelegate> delegate,
30 GaiaCookieManagerService* cookie_manager_service);
31 ~MergeSessionObserverBridge() override;
33 void OnAddAccountToCookieCompleted(
34 const std::string& account_id,
35 const GoogleServiceAuthError& error) override;
37 private:
38 id<MergeSessionObserverBridgeDelegate> delegate_;
39 GaiaCookieManagerService* cookie_manager_service_;
41 DISALLOW_COPY_AND_ASSIGN(MergeSessionObserverBridge);
44 #endif // COMPONENTS_SIGNIN_IOS_BROWSER_MERGE_SESSION_OBSERVER_BRIDGE_H_