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

Unified Diff: chrome/browser/bookmarks/bookmark_model.h

Issue 155456: Try the original CL "Always persist bookmark IDs" again with the fix to... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 months 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
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.cc ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_model.h
===================================================================
--- chrome/browser/bookmarks/bookmark_model.h (revision 20552)
+++ chrome/browser/bookmarks/bookmark_model.h (working copy)
@@ -53,19 +53,18 @@
// Creates a new node with the specified url and id of 0
explicit BookmarkNode(const GURL& url);
// Creates a new node with the specified url and id.
- BookmarkNode(int id, const GURL& url);
+ BookmarkNode(int64 id, const GURL& url);
virtual ~BookmarkNode() {}
// Returns the URL.
const GURL& GetURL() const { return url_; }
// Returns a unique id for this node.
- //
- // NOTE: this id is only unique for the session and NOT unique across
- // sessions. Don't persist it!
- int id() const { return id_; }
+ // For bookmark nodes that are managed by the bookmark model, the IDs are
+ // persisted across sessions.
+ int64 id() const { return id_; }
// Sets the id to the given value.
- void set_id(int id) { id_ = id; }
+ void set_id(int64 id) { id_ = id; }
// Returns the type of this node.
BookmarkNode::Type GetType() const { return type_; }
@@ -126,10 +125,10 @@
private:
// helper to initialize various fields during construction.
- void Initialize(int id);
+ void Initialize(int64 id);
// Unique identifier for this node.
- int id_;
+ int64 id_;
// Whether the favicon has been loaded.
bool loaded_favicon_;
@@ -292,7 +291,7 @@
// Returns the node with the specified id, or NULL if there is no node with
// the specified id.
- const BookmarkNode* GetNodeByID(int id);
+ const BookmarkNode* GetNodeByID(int64 id);
// Adds a new group node at the specified position.
const BookmarkNode* AddGroup(const BookmarkNode* parent,
@@ -355,10 +354,6 @@
// testing.
void ClearStore();
- // Sets/returns whether or not bookmark IDs are persisted or not.
- bool PersistIDs() const { return persist_ids_; }
- void SetPersistIDs(bool value);
-
// Returns whether the bookmarks file changed externally.
bool file_changed() const { return file_changed_; }
@@ -404,7 +399,7 @@
bool was_bookmarked);
// Implementation of GetNodeByID.
- const BookmarkNode* GetNodeByID(const BookmarkNode* node, int id);
+ const BookmarkNode* GetNodeByID(const BookmarkNode* node, int64 id);
// Returns true if the parent and index are valid.
bool IsValidIndex(const BookmarkNode* parent, int index, bool allow_end);
@@ -444,13 +439,12 @@
const NotificationDetails& details);
// Generates and returns the next node ID.
- int generate_next_node_id();
+ int64 generate_next_node_id();
// Sets the maximum node ID to the given value.
// This is used by BookmarkCodec to report the maximum ID after it's done
- // decoding since during decoding codec can assign IDs to nodes if IDs are
- // persisted.
- void set_next_node_id(int id) { next_node_id_ = id; }
+ // decoding since during decoding codec assigns node IDs.
+ void set_next_node_id(int64 id) { next_node_id_ = id; }
// Records that the bookmarks file was changed externally.
void SetFileChanged();
@@ -459,11 +453,6 @@
// the returned object.
BookmarkStorage::LoadDetails* CreateLoadDetails();
- // Registers bookmarks related prefs.
- void RegisterPreferences();
- // Loads bookmark related preferences.
- void LoadPreferences();
-
NotificationRegistrar registrar_;
Profile* profile_;
@@ -471,9 +460,6 @@
// Whether the initial set of data has been loaded.
bool loaded_;
- // Whether to persist bookmark IDs.
- bool persist_ids_;
-
// Whether the bookmarks file was changed externally. This is set after
// loading is complete and once set the value never changes.
bool file_changed_;
@@ -486,7 +472,7 @@
BookmarkNode* other_node_;
// The maximum ID assigned to the bookmark nodes in the model.
- int next_node_id_;
+ int64 next_node_id_;
// The observers.
ObserverList<BookmarkModelObserver> observers_;
« no previous file with comments | « chrome/browser/bookmarks/bookmark_drag_data.cc ('k') | chrome/browser/bookmarks/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698