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_BOOKMARK_POSITION_CACHE_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_POSITION_CACHE_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #include <stdint.h> |
| 11 |
| 12 #include "base/macros.h" |
| 13 #import "ios/chrome/browser/ui/bookmarks/bookmark_menu_item.h" |
| 14 |
| 15 // Caches the user's position in the bookmark hierarchy navigator, as well as |
| 16 // enough information to recreate the primary menu item. |
| 17 @interface BookmarkPositionCache : NSObject<NSCoding> |
| 18 |
| 19 @property(nonatomic, assign, readonly) int64_t folderId; |
| 20 @property(nonatomic, assign, readonly) CGFloat position; |
| 21 @property(nonatomic, assign, readonly) bookmarks::MenuItemType type; |
| 22 |
| 23 + (BookmarkPositionCache*)cacheForMenuItemAllWithPosition:(CGFloat)position; |
| 24 + (BookmarkPositionCache*)cacheForMenuItemFolderWithPosition:(CGFloat)position |
| 25 folderId:(int64_t)folderId; |
| 26 |
| 27 // This is not the designated initializer. It will return nil if there are |
| 28 // problems with the decoding process. |
| 29 - (instancetype)initWithCoder:(NSCoder*)coder; |
| 30 @end |
| 31 |
| 32 @interface BookmarkPositionCache (ExposedForTesting) |
| 33 - (instancetype)initWithFolderId:(int64_t)folderId |
| 34 position:(CGFloat)position |
| 35 type:(bookmarks::MenuItemType)type; |
| 36 @end |
| 37 |
| 38 #endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_POSITION_CACHE_H_ |
OLD | NEW |