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

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

Issue 12550006: Mac: Add a shortcut to open the Apps page from the bookmark bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed failing sync-related tests. Created 7 years, 9 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
Index: chrome/browser/bookmarks/bookmark_model.h
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 3012847228a4d6d3c0e68a646bf613c957a5f731..6d1d7de42c238436f86a30076fc15fded6b6b8d5 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -52,7 +52,8 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> {
FOLDER,
BOOKMARK_BAR,
OTHER_NODE,
- MOBILE
+ MOBILE,
+ APPS_NODE
};
enum FaviconState {
@@ -104,7 +105,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode> {
// Convenience for testing if this node represents a folder. A folder is a
// node whose type is not URL.
- bool is_folder() const { return type_ != URL; }
+ bool is_folder() const { return type_ != URL && type_ != APPS_NODE; }
bool is_url() const { return type_ == URL; }
bool is_favicon_loaded() const { return favicon_state_ == LOADED_FAVICON; }
@@ -255,15 +256,20 @@ class BookmarkModel : public content::NotificationObserver,
// Returns the 'mobile' node. This is NULL until loaded.
const BookmarkNode* mobile_node() { return mobile_node_; }
+ // Returns the 'apps' node. This is NULL until loaded or if there is no apps
+ // node.
+ const BookmarkNode* apps_node() { return apps_node_.get(); }
+
bool is_root_node(const BookmarkNode* node) const { return node == &root_; }
// Returns whether the given |node| is one of the permanent nodes - root node,
- // 'bookmark bar' node, 'other' node or 'mobile' node.
+ // 'bookmark bar' node, 'other' node, 'mobile' node or 'apps' node.
bool is_permanent_node(const BookmarkNode* node) const {
return node == &root_ ||
node == bookmark_bar_node_ ||
node == other_node_ ||
- node == mobile_node_;
+ node == mobile_node_ ||
+ node == apps_node_.get();
}
Profile* profile() { return profile_; }
@@ -499,6 +505,10 @@ class BookmarkModel : public content::NotificationObserver,
BookmarkPermanentNode* other_node_;
BookmarkPermanentNode* mobile_node_;
+ // A special node used to render the bookmark menu but that is not kept under
+ // |root_|, so we have to release it by itself.
+ scoped_ptr<BookmarkPermanentNode> apps_node_;
+
// The maximum ID assigned to the bookmark nodes in the model.
int64 next_node_id_;

Powered by Google App Engine
This is Rietveld 408576698