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