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 IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ |
6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ | 6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "components/undo/undo_manager_observer.h" | 9 #include "components/undo/undo_manager_observer.h" |
10 | 10 |
11 // The ObjC translations of the C++ observer callbacks are defined here. | 11 // The ObjC translations of the C++ observer callbacks are defined here. |
12 @protocol UndoManagerBridgeObserver | 12 @protocol UndoManagerBridgeObserver |
13 // Invoked when the internal state of the undo manager has changed. | 13 // Invoked when the internal state of the undo manager has changed. |
14 - (void)undoManagerChanged; | 14 - (void)undoManagerChanged; |
15 @end | 15 @end |
16 | 16 |
17 namespace bookmarks { | 17 namespace bookmarks { |
18 // A bridge that translates UndoManagerObserver C++ callbacks into ObjC | 18 // A bridge that translates UndoManagerObserver C++ callbacks into ObjC |
19 // callbacks. | 19 // callbacks. |
20 class UndoManagerBridge : public UndoManagerObserver { | 20 class UndoManagerBridge : public UndoManagerObserver { |
21 public: | 21 public: |
22 explicit UndoManagerBridge(id<UndoManagerBridgeObserver> observer); | 22 explicit UndoManagerBridge(id<UndoManagerBridgeObserver> observer); |
23 ~UndoManagerBridge() override{}; | 23 ~UndoManagerBridge() override {} |
24 | 24 |
25 private: | 25 private: |
26 void OnUndoManagerStateChange() override; | 26 void OnUndoManagerStateChange() override; |
27 __weak id<UndoManagerBridgeObserver> observer_; | 27 __weak id<UndoManagerBridgeObserver> observer_; |
28 }; | 28 }; |
29 } // namespace bookmarks | 29 } // namespace bookmarks |
30 | 30 |
31 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ | 31 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_UNDO_MANAGER_BRIDGE_OBSERVER_H_ |
OLD | NEW |