Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h

Issue 2586993002: Upstream Chrome on iOS source code [3/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h b/ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h
new file mode 100644
index 0000000000000000000000000000000000000000..c999f9701383255f23d0740474ed0631e9925c47
--- /dev/null
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_position_cache.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_POSITION_CACHE_H_
+#define IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_POSITION_CACHE_H_
+
+#import <Foundation/Foundation.h>
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#import "ios/chrome/browser/ui/bookmarks/bookmark_menu_item.h"
+
+// Caches the user's position in the bookmark hierarchy navigator, as well as
+// enough information to recreate the primary menu item.
+@interface BookmarkPositionCache : NSObject<NSCoding>
+
+@property(nonatomic, assign, readonly) int64_t folderId;
+@property(nonatomic, assign, readonly) CGFloat position;
+@property(nonatomic, assign, readonly) bookmarks::MenuItemType type;
+
++ (BookmarkPositionCache*)cacheForMenuItemAllWithPosition:(CGFloat)position;
++ (BookmarkPositionCache*)cacheForMenuItemFolderWithPosition:(CGFloat)position
+ folderId:(int64_t)folderId;
+
+// This is not the designated initializer. It will return nil if there are
+// problems with the decoding process.
+- (instancetype)initWithCoder:(NSCoder*)coder;
+@end
+
+@interface BookmarkPositionCache (ExposedForTesting)
+- (instancetype)initWithFolderId:(int64_t)folderId
+ position:(CGFloat)position
+ type:(bookmarks::MenuItemType)type;
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_POSITION_CACHE_H_
« no previous file with comments | « ios/chrome/browser/ui/bookmarks/bookmark_panel_view.mm ('k') | ios/chrome/browser/ui/bookmarks/bookmark_position_cache.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698