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

Side by Side Diff: base/clipboard_mac.mm

Issue 17395: - Match up w/ NSPasteboard docs and mark sure our special type is on the... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/clipboard.h" 5 #include "base/clipboard.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 NSPasteboard* pb = GetPasteboard(); 123 NSPasteboard* pb = GetPasteboard();
124 [pb addTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil]; 124 [pb addTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:nil];
125 [pb setPropertyList:fileList forType:NSFilenamesPboardType]; 125 [pb setPropertyList:fileList forType:NSFilenamesPboardType];
126 } 126 }
127 127
128 // Write an extra flavor that signifies WebKit was the last to modify the 128 // Write an extra flavor that signifies WebKit was the last to modify the
129 // pasteboard. This flavor has no data. 129 // pasteboard. This flavor has no data.
130 void Clipboard::WriteWebSmartPaste() { 130 void Clipboard::WriteWebSmartPaste() {
131 NSPasteboard* pb = GetPasteboard(); 131 NSPasteboard* pb = GetPasteboard();
132 [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 132 [pb addTypes:[NSArray arrayWithObject:GetWebKitSmartPasteFormatType()] owner:n il];
133 [pb setData:nil forType:GetWebKitSmartPasteFormatType()]; 133 [pb setData:nil forType:GetWebKitSmartPasteFormatType()];
134 } 134 }
135 135
136 bool Clipboard::IsFormatAvailable(NSString* format) const { 136 bool Clipboard::IsFormatAvailable(NSString* format) const {
137 NSPasteboard* pb = GetPasteboard(); 137 NSPasteboard* pb = GetPasteboard();
138 NSArray* types = [pb types]; 138 NSArray* types = [pb types];
139 139
140 return [types containsObject:format]; 140 return [types containsObject:format];
141 } 141 }
142 142
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 // static 261 // static
262 Clipboard::FormatType Clipboard::GetHtmlFormatType() { 262 Clipboard::FormatType Clipboard::GetHtmlFormatType() {
263 return NSHTMLPboardType; 263 return NSHTMLPboardType;
264 } 264 }
265 265
266 // static 266 // static
267 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { 267 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
268 return kWebSmartPastePboardType; 268 return kWebSmartPastePboardType;
269 } 269 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698