1 // Copyright 2015 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_AUTOFILL_IOS_BROWSER_PERSONAL_DATA_MANAGER_OBSERVER_BRIDGE_H_
6 #define COMPONENTS_AUTOFILL_IOS_BROWSER_PERSONAL_DATA_MANAGER_OBSERVER_BRIDGE_H_
8 #import <Foundation/Foundation.h>
10 #include "base/macros.h"
11 #include "components/autofill/core/browser/personal_data_manager_observer.h"
13 // PersonalDataManagerObserverBridgeDelegate is used by PersonalDataManager to
14 // informs its client implemented in Objective-C when it has finished loading
15 // personal data from the web database.
16 @protocol PersonalDataManagerObserverBridgeDelegate
<NSObject
>
18 // Called when the PersonalDataManager changed in some way.
19 - (void)onPersonalDataChanged
;
23 // Called when there is insufficient data to fill a form.
24 - (void)onInsufficientFormData
;
30 // PersonalDataManagerObserverBridge forwards PersonalDataManager notification
31 // to an Objective-C delegate.
32 class PersonalDataManagerObserverBridge
: public PersonalDataManagerObserver
{
34 explicit PersonalDataManagerObserverBridge(
35 id
<PersonalDataManagerObserverBridgeDelegate
> delegate
);
36 ~PersonalDataManagerObserverBridge() override
;
38 // PersonalDataManagerObserver implementation.
39 void OnPersonalDataChanged() override
;
40 void OnInsufficientFormData() override
;
43 id
<PersonalDataManagerObserverBridgeDelegate
> delegate_
; // Weak.
45 DISALLOW_COPY_AND_ASSIGN(PersonalDataManagerObserverBridge
);
48 } // namespace autofill
50 #endif // COMPONENTS_AUTOFILL_IOS_BROWSER_PERSONAL_DATA_MANAGER_OBSERVER_BRIDGE_H_