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

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: 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..8a499b9401bde48ab5bfaba63e9f5fee9278c956 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_; }
+
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_;
}
Profile* profile() { return profile_; }
@@ -498,6 +504,7 @@ class BookmarkModel : public content::NotificationObserver,
BookmarkPermanentNode* bookmark_bar_node_;
BookmarkPermanentNode* other_node_;
BookmarkPermanentNode* mobile_node_;
+ BookmarkPermanentNode* apps_node_;
// The maximum ID assigned to the bookmark nodes in the model.
int64 next_node_id_;
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_model.cc » ('j') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698