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