| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "ui/base/dragdrop/os_exchange_data.h" | 10 #include "ui/base/dragdrop/os_exchange_data.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 if (data.HasCustomFormat(GetBookmarkFormatType())) { | 50 if (data.HasCustomFormat(GetBookmarkFormatType())) { |
| 51 base::Pickle drag_data_pickle; | 51 base::Pickle drag_data_pickle; |
| 52 if (data.GetPickledData(GetBookmarkFormatType(), &drag_data_pickle)) { | 52 if (data.GetPickledData(GetBookmarkFormatType(), &drag_data_pickle)) { |
| 53 if (!ReadFromPickle(&drag_data_pickle)) | 53 if (!ReadFromPickle(&drag_data_pickle)) |
| 54 return false; | 54 return false; |
| 55 } | 55 } |
| 56 } else { | 56 } else { |
| 57 // See if there is a URL on the clipboard. | 57 // See if there is a URL on the clipboard. |
| 58 GURL url; | 58 GURL url; |
| 59 base::string16 title; | 59 base::string16 title; |
| 60 if (data.GetURLAndTitle( | 60 if (data.GetURLAndTitle(ui::OSExchangeData::CONVERT_FILENAMES, |
| 61 ui::OSExchangeData::CONVERT_FILENAMES, &url, &title)) | 61 ui::OSExchangeData::PARSE_TEXT_AS_URL, &url, |
| 62 &title)) |
| 62 ReadFromTuple(url, title); | 63 ReadFromTuple(url, title); |
| 63 } | 64 } |
| 64 | 65 |
| 65 return is_valid(); | 66 return is_valid(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace bookmarks | 69 } // namespace bookmarks |
| OLD | NEW |