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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 BookmarkNodeData::~BookmarkNodeData() { | 114 BookmarkNodeData::~BookmarkNodeData() { |
115 } | 115 } |
116 | 116 |
117 #if !defined(OS_MACOSX) | 117 #if !defined(OS_MACOSX) |
118 // static | 118 // static |
119 bool BookmarkNodeData::ClipboardContainsBookmarks() { | 119 bool BookmarkNodeData::ClipboardContainsBookmarks() { |
120 return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable( | 120 return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable( |
121 ui::Clipboard::GetFormatType(kClipboardFormatString), | 121 ui::Clipboard::GetFormatType(kClipboardFormatString), |
122 ui::CLIPBOARD_TYPE_COPY_PASTE); | 122 ui::CLIPBOARD_TYPE_COPY_PASTE); |
123 } | 123 } |
| 124 |
| 125 bool BookmarkNodeData::ClipboardContainsUrls() { |
| 126 return ui::Clipboard::GetForCurrentThread()->IsFormatAvailable( |
| 127 ui::Clipboard::GetUrlWFormatType(), ui::CLIPBOARD_TYPE_COPY_PASTE); |
| 128 } |
124 #endif | 129 #endif |
125 | 130 |
126 bool BookmarkNodeData::ReadFromVector( | 131 bool BookmarkNodeData::ReadFromVector( |
127 const std::vector<const BookmarkNode*>& nodes) { | 132 const std::vector<const BookmarkNode*>& nodes) { |
128 Clear(); | 133 Clear(); |
129 | 134 |
130 if (nodes.empty()) | 135 if (nodes.empty()) |
131 return false; | 136 return false; |
132 | 137 |
133 for (size_t i = 0; i < nodes.size(); ++i) | 138 for (size_t i = 0; i < nodes.size(); ++i) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 profile_path_ = profile_path; | 286 profile_path_ = profile_path; |
282 } | 287 } |
283 | 288 |
284 bool BookmarkNodeData::IsFromProfilePath( | 289 bool BookmarkNodeData::IsFromProfilePath( |
285 const base::FilePath& profile_path) const { | 290 const base::FilePath& profile_path) const { |
286 // An empty path means the data is not associated with any profile. | 291 // An empty path means the data is not associated with any profile. |
287 return !profile_path_.empty() && profile_path_ == profile_path; | 292 return !profile_path_.empty() && profile_path_ == profile_path; |
288 } | 293 } |
289 | 294 |
290 } // namespace bookmarks | 295 } // namespace bookmarks |
OLD | NEW |