summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks/bookmark_model.h
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 18:01:28 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-20 18:01:28 +0000
commitea2e5aa57f173880eabea2054729b5e1bc6b3560 (patch)
tree131b44e7c74f50e1bd819680027d3fb589b156f0 /chrome/browser/bookmarks/bookmark_model.h
parentd47dbff4e1e960450c9a1b0666035de2fce88ee9 (diff)
downloadchromium_src-ea2e5aa57f173880eabea2054729b5e1bc6b3560.zip
chromium_src-ea2e5aa57f173880eabea2054729b5e1bc6b3560.tar.gz
chromium_src-ea2e5aa57f173880eabea2054729b5e1bc6b3560.tar.bz2
Moves GetFavIcon from BookmarkNode to BookmarkModel. I'm doing this
for two reasons: . it cuts down on each node needing a reference to the model. . it makes it clear nodes shouldn't need to talk with the model. I'm primarily doing this for the last point as I'm going to populate nodes on a background thread shortly and I don't want to risk the chance of someone trying to talk with the model. BUG=none TEST=none Review URL: http://codereview.chromium.org/113617 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16491 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks/bookmark_model.h')
-rw-r--r--chrome/browser/bookmarks/bookmark_model.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 8552e26..43484eb 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -56,10 +56,6 @@ class BookmarkNode : public TreeNode<BookmarkNode> {
public:
virtual ~BookmarkNode() {}
- // Returns the favicon for the this node. If the favicon has not yet been
- // loaded it is loaded and the observer of the model notified when done.
- const SkBitmap& GetFavIcon();
-
// Returns the URL.
const GURL& GetURL() const { return url_; }
@@ -99,12 +95,17 @@ class BookmarkNode : public TreeNode<BookmarkNode> {
// HistoryContentsProvider.
private:
- // Creates a new node with the given properties.
- BookmarkNode(BookmarkModel* model, const GURL& url);
- BookmarkNode(BookmarkModel* model, int id, const GURL& url);
+ // 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);
+
+ // Returns the favicon for the this node. If the favicon has not yet been
+ // loaded it is loaded and the observer of the model notified when done.
+ const SkBitmap& favicon() const { return favicon_; }
// helper to initialize various fields during construction.
- void Initialize(BookmarkModel* model, int id);
+ void Initialize(int id);
// Resets the properties of the node from the supplied entry.
void Reset(const history::StarredEntry& entry);
@@ -112,9 +113,6 @@ class BookmarkNode : public TreeNode<BookmarkNode> {
// Sets the id to the given value.
void set_id(int id) { id_ = id; }
- // The model. This is NULL when created by StarredURLDatabase for migration.
- BookmarkModel* model_;
-
// Unique identifier for this node.
int id_;
@@ -249,6 +247,10 @@ class BookmarkModel : public NotificationObserver, public BookmarkService {
// Moves the specified entry to a new location.
void Move(BookmarkNode* node, BookmarkNode* new_parent, int index);
+ // Returns the favicon for |node|. If the favicon has not yet been
+ // loaded it is loaded and the observer of the model notified when done.
+ const SkBitmap& GetFavIcon(BookmarkNode* node);
+
// Sets the title of the specified node.
void SetTitle(BookmarkNode* node, const std::wstring& title);