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_data.h" | 5 #include "components/bookmarks/browser/bookmark_node_data.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "components/bookmarks/browser/bookmark_utils.h" | 12 #include "components/bookmarks/browser/bookmark_utils.h" |
13 #include "ui/base/clipboard/scoped_clipboard_writer.h" | 13 #include "ui/base/clipboard/scoped_clipboard_writer.h" |
14 | 14 |
15 namespace bookmarks { | 15 namespace bookmarks { |
16 | 16 |
17 const char* BookmarkNodeData::kClipboardFormatString = | 17 const char BookmarkNodeData::kClipboardFormatString[] = |
18 "chromium/x-bookmark-entries"; | 18 "chromium/x-bookmark-entries"; |
19 | 19 |
20 BookmarkNodeData::Element::Element() : is_url(false), id_(0) { | 20 BookmarkNodeData::Element::Element() : is_url(false), id_(0) { |
21 } | 21 } |
22 | 22 |
23 BookmarkNodeData::Element::Element(const BookmarkNode* node) | 23 BookmarkNodeData::Element::Element(const BookmarkNode* node) |
24 : is_url(node->is_url()), | 24 : is_url(node->is_url()), |
25 url(node->url()), | 25 url(node->url()), |
26 title(node->GetTitle()), | 26 title(node->GetTitle()), |
27 date_added(node->date_added()), | 27 date_added(node->date_added()), |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 profile_path_ = profile_path; | 294 profile_path_ = profile_path; |
295 } | 295 } |
296 | 296 |
297 bool BookmarkNodeData::IsFromProfilePath( | 297 bool BookmarkNodeData::IsFromProfilePath( |
298 const base::FilePath& profile_path) const { | 298 const base::FilePath& profile_path) const { |
299 // An empty path means the data is not associated with any profile. | 299 // An empty path means the data is not associated with any profile. |
300 return !profile_path_.empty() && profile_path_ == profile_path; | 300 return !profile_path_.empty() && profile_path_ == profile_path; |
301 } | 301 } |
302 | 302 |
303 } // namespace bookmarks | 303 } // namespace bookmarks |
OLD | NEW |