Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm

Issue 2028823003: Mac: Make ScopedTypeRef require explicit constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove dependency Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 if ([urls count] > 0) { 221 if ([urls count] > 0) {
222 if ([urls count] == 1) { 222 if ([urls count] == 1) {
223 item = ui::ClipboardUtil::PasteboardItemFromUrl([urls firstObject], 223 item = ui::ClipboardUtil::PasteboardItemFromUrl([urls firstObject],
224 [url_titles firstObject]); 224 [url_titles firstObject]);
225 } else { 225 } else {
226 item = ui::ClipboardUtil::PasteboardItemFromUrls(urls, url_titles); 226 item = ui::ClipboardUtil::PasteboardItemFromUrls(urls, url_titles);
227 } 227 }
228 } 228 }
229 229
230 if (!item) { 230 if (!item) {
231 item = [[NSPasteboardItem alloc] init]; 231 item.reset([[NSPasteboardItem alloc] init]);
232 } 232 }
233 233
234 [item setString:[toplevel_string_data componentsJoinedByString:@"\n"] 234 [item setString:[toplevel_string_data componentsJoinedByString:@"\n"]
235 forType:NSPasteboardTypeString]; 235 forType:NSPasteboardTypeString];
236 return item; 236 return item;
237 } 237 }
238 238
239 NSPasteboard* PasteboardFromType(ui::ClipboardType type) { 239 NSPasteboard* PasteboardFromType(ui::ClipboardType type) {
240 NSString* type_string = nil; 240 NSString* type_string = nil;
241 switch (type) { 241 switch (type) {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.mm ('k') | device/bluetooth/test/bluetooth_test_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698