| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ | 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ |
| 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ | 6 #define COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/task/cancelable_task_tracker.h" | 9 #include "base/task/cancelable_task_tracker.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "components/favicon_base/favicon_types.h" | 11 #include "components/favicon_base/favicon_types.h" |
| 12 #include "ui/base/models/tree_node_model.h" | 12 #include "ui/base/models/tree_node_model.h" |
| 13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace bookmarks { | 16 namespace bookmarks { |
| 17 |
| 17 class BookmarkModel; | 18 class BookmarkModel; |
| 18 } | |
| 19 | 19 |
| 20 // BookmarkNode --------------------------------------------------------------- | 20 // BookmarkNode --------------------------------------------------------------- |
| 21 | 21 |
| 22 // BookmarkNode contains information about a starred entry: title, URL, favicon, | 22 // BookmarkNode contains information about a starred entry: title, URL, favicon, |
| 23 // id and type. BookmarkNodes are returned from BookmarkModel. | 23 // id and type. BookmarkNodes are returned from BookmarkModel. |
| 24 class BookmarkNode : public ui::TreeNode<BookmarkNode> { | 24 class BookmarkNode : public ui::TreeNode<BookmarkNode> { |
| 25 public: | 25 public: |
| 26 enum Type { | 26 enum Type { |
| 27 URL, | 27 URL, |
| 28 FOLDER, | 28 FOLDER, |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 sync_transaction_version_ = sync_transaction_version; | 110 sync_transaction_version_ = sync_transaction_version; |
| 111 } | 111 } |
| 112 int64 sync_transaction_version() const { | 112 int64 sync_transaction_version() const { |
| 113 return sync_transaction_version_; | 113 return sync_transaction_version_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 // TODO(sky): Consider adding last visit time here, it'll greatly simplify | 116 // TODO(sky): Consider adding last visit time here, it'll greatly simplify |
| 117 // HistoryContentsProvider. | 117 // HistoryContentsProvider. |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 friend class bookmarks::BookmarkModel; | 120 friend class BookmarkModel; |
| 121 | 121 |
| 122 // A helper function to initialize various fields during construction. | 122 // A helper function to initialize various fields during construction. |
| 123 void Initialize(int64 id); | 123 void Initialize(int64 id); |
| 124 | 124 |
| 125 // Called when the favicon becomes invalid. | 125 // Called when the favicon becomes invalid. |
| 126 void InvalidateFavicon(); | 126 void InvalidateFavicon(); |
| 127 | 127 |
| 128 // Sets the favicon's URL. | 128 // Sets the favicon's URL. |
| 129 void set_icon_url(const GURL& icon_url) { | 129 void set_icon_url(const GURL& icon_url) { |
| 130 icon_url_ = icon_url; | 130 icon_url_ = icon_url; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 // BookmarkNode overrides: | 205 // BookmarkNode overrides: |
| 206 bool IsVisible() const override; | 206 bool IsVisible() const override; |
| 207 | 207 |
| 208 private: | 208 private: |
| 209 bool visible_; | 209 bool visible_; |
| 210 | 210 |
| 211 DISALLOW_COPY_AND_ASSIGN(BookmarkPermanentNode); | 211 DISALLOW_COPY_AND_ASSIGN(BookmarkPermanentNode); |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 } // namespace bookmarks |
| 215 |
| 214 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ | 216 #endif // COMPONENTS_BOOKMARKS_BROWSER_BOOKMARK_NODE_H_ |
| OLD | NEW |