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 #include "components/bookmarks/browser/bookmark_node.h" | 5 #include "components/bookmarks/browser/bookmark_node.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 if (meta_info_map.empty()) | 96 if (meta_info_map.empty()) |
97 meta_info_map_.reset(); | 97 meta_info_map_.reset(); |
98 else | 98 else |
99 meta_info_map_.reset(new MetaInfoMap(meta_info_map)); | 99 meta_info_map_.reset(new MetaInfoMap(meta_info_map)); |
100 } | 100 } |
101 | 101 |
102 const BookmarkNode::MetaInfoMap* BookmarkNode::GetMetaInfoMap() const { | 102 const BookmarkNode::MetaInfoMap* BookmarkNode::GetMetaInfoMap() const { |
103 return meta_info_map_.get(); | 103 return meta_info_map_.get(); |
104 } | 104 } |
105 | 105 |
| 106 const base::string16& BookmarkNode::GetTitledUrlNodeTitle() const { |
| 107 return GetTitle(); |
| 108 } |
| 109 |
| 110 const GURL& BookmarkNode::GetTitledUrlNodeUrl() const { |
| 111 return url_; |
| 112 } |
| 113 |
106 void BookmarkNode::Initialize(int64_t id) { | 114 void BookmarkNode::Initialize(int64_t id) { |
107 id_ = id; | 115 id_ = id; |
108 type_ = url_.is_empty() ? FOLDER : URL; | 116 type_ = url_.is_empty() ? FOLDER : URL; |
109 date_added_ = base::Time::Now(); | 117 date_added_ = base::Time::Now(); |
110 favicon_type_ = favicon_base::INVALID_ICON; | 118 favicon_type_ = favicon_base::INVALID_ICON; |
111 favicon_state_ = INVALID_FAVICON; | 119 favicon_state_ = INVALID_FAVICON; |
112 favicon_load_task_id_ = base::CancelableTaskTracker::kBadTaskId; | 120 favicon_load_task_id_ = base::CancelableTaskTracker::kBadTaskId; |
113 meta_info_map_.reset(); | 121 meta_info_map_.reset(); |
114 sync_transaction_version_ = kInvalidSyncTransactionVersion; | 122 sync_transaction_version_ = kInvalidSyncTransactionVersion; |
115 } | 123 } |
(...skipping 11 matching lines...) Expand all Loading... |
127 : BookmarkNode(id, GURL()), visible_(true) {} | 135 : BookmarkNode(id, GURL()), visible_(true) {} |
128 | 136 |
129 BookmarkPermanentNode::~BookmarkPermanentNode() { | 137 BookmarkPermanentNode::~BookmarkPermanentNode() { |
130 } | 138 } |
131 | 139 |
132 bool BookmarkPermanentNode::IsVisible() const { | 140 bool BookmarkPermanentNode::IsVisible() const { |
133 return visible_ || !empty(); | 141 return visible_ || !empty(); |
134 } | 142 } |
135 | 143 |
136 } // namespace bookmarks | 144 } // namespace bookmarks |
OLD | NEW |