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_pasteboard_helper_mac.h" | 5 #include "components/bookmarks/browser/bookmark_pasteboard_helper_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 return meta_info_map; | 51 return meta_info_map; |
52 } | 52 } |
53 | 53 |
54 void ConvertPlistToElements(NSArray* input, | 54 void ConvertPlistToElements(NSArray* input, |
55 std::vector<BookmarkNodeData::Element>& elements) { | 55 std::vector<BookmarkNodeData::Element>& elements) { |
56 NSUInteger len = [input count]; | 56 NSUInteger len = [input count]; |
57 for (NSUInteger i = 0; i < len; ++i) { | 57 for (NSUInteger i = 0; i < len; ++i) { |
58 NSDictionary* pboardBookmark = [input objectAtIndex:i]; | 58 NSDictionary* pboardBookmark = [input objectAtIndex:i]; |
59 scoped_ptr<BookmarkNode> new_node(new BookmarkNode(GURL())); | 59 std::unique_ptr<BookmarkNode> new_node(new BookmarkNode(GURL())); |
60 int64_t node_id = | 60 int64_t node_id = |
61 [[pboardBookmark objectForKey:kChromiumBookmarkId] longLongValue]; | 61 [[pboardBookmark objectForKey:kChromiumBookmarkId] longLongValue]; |
62 new_node->set_id(node_id); | 62 new_node->set_id(node_id); |
63 | 63 |
64 NSDictionary* metaInfoDictionary = | 64 NSDictionary* metaInfoDictionary = |
65 [pboardBookmark objectForKey:kChromiumBookmarkMetaInfo]; | 65 [pboardBookmark objectForKey:kChromiumBookmarkMetaInfo]; |
66 if (metaInfoDictionary) | 66 if (metaInfoDictionary) |
67 new_node->SetMetaInfoMap(MetaInfoMapFromDictionary(metaInfoDictionary)); | 67 new_node->SetMetaInfoMap(MetaInfoMapFromDictionary(metaInfoDictionary)); |
68 | 68 |
69 BOOL is_folder = [[pboardBookmark objectForKey:kWebBookmarkType] | 69 BOOL is_folder = [[pboardBookmark objectForKey:kWebBookmarkType] |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 NSPasteboard* pb = PasteboardFromType(type); | 301 NSPasteboard* pb = PasteboardFromType(type); |
302 | 302 |
303 NSArray* availableTypes = @[ | 303 NSArray* availableTypes = @[ |
304 ui::ClipboardUtil::UTIForWebURLsAndTitles(), | 304 ui::ClipboardUtil::UTIForWebURLsAndTitles(), |
305 ui::ClipboardUtil::UTIForPasteboardType(kBookmarkDictionaryListPboardType) | 305 ui::ClipboardUtil::UTIForPasteboardType(kBookmarkDictionaryListPboardType) |
306 ]; | 306 ]; |
307 return [pb availableTypeFromArray:availableTypes] != nil; | 307 return [pb availableTypeFromArray:availableTypes] != nil; |
308 } | 308 } |
309 | 309 |
310 } // namespace bookmarks | 310 } // namespace bookmarks |
OLD | NEW |