Index: chrome/browser/bookmarks/bookmark_model.h |
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h |
index a6a74602b5ae6c90d62767d27476910e1885338d..8c5c16faf016cdb8df0fc1de966dc98e27da5e70 100644 |
--- a/chrome/browser/bookmarks/bookmark_model.h |
+++ b/chrome/browser/bookmarks/bookmark_model.h |
@@ -38,9 +38,8 @@ struct TitleMatch; |
// BookmarkNode --------------------------------------------------------------- |
-// BookmarkNode contains information about a starred entry: title, URL, favicon, |
-// star id and type. BookmarkNodes are returned from a BookmarkModel. |
-// |
+// BookmarkNode contains information about a starred entry: id, type, title, |
+// URL, favicon. BookmarkNodes are returned from BookmarkModel. |
class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
public: |
enum Type { |
@@ -50,25 +49,23 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
OTHER_NODE, |
SYNCED |
}; |
- // Creates a new node with the specified url and id of 0 |
+ |
+ // Creates a new node with id of 0 and |url|. |
explicit BookmarkNode(const GURL& url); |
- // Creates a new node with the specified url and id. |
+ // Creates a new node with |id| and |url|. |
BookmarkNode(int64 id, const GURL& url); |
+ |
virtual ~BookmarkNode(); |
- // Returns the URL. |
const GURL& GetURL() const { return url_; } |
- // Sets the URL to the given value. |
void SetURL(const GURL& url) { url_ = url; } |
// Returns a unique id for this node. |
// 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(int64 id) { id_ = id; } |
- // Returns the type of this node. |
Type type() const { return type_; } |
void set_type(Type type) { type_ = type; } |
@@ -82,7 +79,6 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
const base::Time& date_folder_modified() const { |
return date_folder_modified_; |
} |
- // Sets the last time the folder was modified. |
void set_date_folder_modified(const base::Time& date) { |
date_folder_modified_ = date; |
} |
@@ -104,8 +100,15 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
// The following methods are used by the bookmark model, and are not |
// really useful outside of it. |
- bool is_favicon_loaded() const { return loaded_favicon_; } |
- void set_favicon_loaded(bool value) { loaded_favicon_ = value; } |
+ bool favicon_loaded() const { return favicon_loaded_; } |
+ void set_favicon_loaded(bool loaded) { favicon_loaded_ = loaded; } |
+ |
+ HistoryService::Handle favicon_load_handle() const { |
+ return favicon_load_handle_; |
+ } |
+ void set_favicon_load_handle(HistoryService::Handle handle) { |
+ favicon_load_handle_ = handle; |
+ } |
// Accessor method for controlling the visibility of a bookmark node/sub-tree. |
// Note that visibility is not propagated down the tree hierarchy so if a |
@@ -116,13 +119,6 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
// no longer a command line flag. |
bool IsVisible() const; |
- HistoryService::Handle favicon_load_handle() const { |
- return favicon_load_handle_; |
- } |
- void set_favicon_load_handle(HistoryService::Handle handle) { |
- favicon_load_handle_ = handle; |
- } |
- |
// Called when the favicon becomes invalid. |
void InvalidateFavicon(); |
@@ -132,35 +128,35 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
private: |
friend class BookmarkModel; |
- // Helper to initialize various fields during construction. |
+ // A helper function to initialize some of the variables below. |
void Initialize(int64 id); |
- // Unique identifier for this node. |
+ // The unique identifier for this node. |
int64 id_; |
- // Whether the favicon has been loaded. |
- bool loaded_favicon_; |
- |
- // The favicon. |
- SkBitmap favicon_; |
- |
- // If non-zero, it indicates we're loading the favicon and this is the handle |
- // from the HistoryService. |
- HistoryService::Handle favicon_load_handle_; |
- |
- // The URL. BookmarkModel maintains maps off this URL, it is important that |
- // changes to the URL is done through the bookmark model. |
+ // The URL of this node. BookmarkModel maintains maps off this URL, so changes |
+ // changes to the URL should be done through the BookmarkModel. |
GURL url_; |
- // Type of node. |
+ // The type of this node. See enum above. |
Type type_; |
- // Date we were created. |
+ // Date of when this node was created. |
base::Time date_added_; |
- // Time last modified. Only used for folders. |
+ // Date of the last modification. Only used for folders. |
base::Time date_folder_modified_; |
+ // The favicon of this node. |
+ SkBitmap favicon_; |
+ |
+ // Whether the favicon has been loaded. |
+ bool favicon_loaded_; |
+ |
+ // If non-zero, it indicates we're loading the favicon and this is the handle |
+ // from the HistoryService. |
+ HistoryService::Handle favicon_load_handle_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BookmarkNode); |
}; |