| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/bookmarks/bookmark_drag_data.h" | 5 #include "chrome/browser/bookmarks/bookmark_drag_data.h" |
| 6 | 6 |
| 7 #include "app/clipboard/scoped_clipboard_writer.h" | 7 #include "app/clipboard/scoped_clipboard_writer.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 nodes.push_back(node); | 254 nodes.push_back(node); |
| 255 } | 255 } |
| 256 return nodes; | 256 return nodes; |
| 257 } | 257 } |
| 258 | 258 |
| 259 const BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const { | 259 const BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const { |
| 260 std::vector<const BookmarkNode*> nodes = GetNodes(profile); | 260 std::vector<const BookmarkNode*> nodes = GetNodes(profile); |
| 261 return nodes.size() == 1 ? nodes[0] : NULL; | 261 return nodes.size() == 1 ? nodes[0] : NULL; |
| 262 } | 262 } |
| 263 | 263 |
| 264 void BookmarkDragData::Clear() { |
| 265 profile_path_.clear(); |
| 266 elements.clear(); |
| 267 } |
| 268 |
| 264 bool BookmarkDragData::IsFromProfile(Profile* profile) const { | 269 bool BookmarkDragData::IsFromProfile(Profile* profile) const { |
| 265 // An empty path means the data is not associated with any profile. | 270 // An empty path means the data is not associated with any profile. |
| 266 return (!profile_path_.empty() && | 271 return (!profile_path_.empty() && |
| 267 #if defined(WCHAR_T_IS_UTF16) | 272 #if defined(WCHAR_T_IS_UTF16) |
| 268 profile->GetPath().ToWStringHack() == profile_path_); | 273 profile->GetPath().ToWStringHack() == profile_path_); |
| 269 #elif defined(WCHAR_T_IS_UTF32) | 274 #elif defined(WCHAR_T_IS_UTF32) |
| 270 profile->GetPath().value() == profile_path_); | 275 profile->GetPath().value() == profile_path_); |
| 271 #endif | 276 #endif |
| 272 } | 277 } |
| OLD | NEW |