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

Side by Side Diff: ui/base/clipboard/clipboard_mac.mm

Issue 8634002: Revert 111080 - Remove Task inheritance in clipboard code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_win.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/base/clipboard/clipboard.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 void Clipboard::WriteObjects(const ObjectMap& objects) { 50 void Clipboard::WriteObjects(const ObjectMap& objects) {
51 NSPasteboard* pb = GetPasteboard(); 51 NSPasteboard* pb = GetPasteboard();
52 [pb declareTypes:[NSArray array] owner:nil]; 52 [pb declareTypes:[NSArray array] owner:nil];
53 53
54 for (ObjectMap::const_iterator iter = objects.begin(); 54 for (ObjectMap::const_iterator iter = objects.begin();
55 iter != objects.end(); ++iter) { 55 iter != objects.end(); ++iter) {
56 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); 56 DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
57 } 57 }
58
58 } 59 }
59 60
60 void Clipboard::WriteText(const char* text_data, size_t text_len) { 61 void Clipboard::WriteText(const char* text_data, size_t text_len) {
61 std::string text_str(text_data, text_len); 62 std::string text_str(text_data, text_len);
62 NSString *text = base::SysUTF8ToNSString(text_str); 63 NSString *text = base::SysUTF8ToNSString(text_str);
63 NSPasteboard* pb = GetPasteboard(); 64 NSPasteboard* pb = GetPasteboard();
64 [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 65 [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
65 [pb setString:text forType:NSStringPboardType]; 66 [pb setString:text forType:NSStringPboardType];
66 } 67 }
67 68
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 Clipboard::FormatType Clipboard::GetBitmapFormatType() { 375 Clipboard::FormatType Clipboard::GetBitmapFormatType() {
375 return base::SysNSStringToUTF8(NSTIFFPboardType); 376 return base::SysNSStringToUTF8(NSTIFFPboardType);
376 } 377 }
377 378
378 // static 379 // static
379 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { 380 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
380 return base::SysNSStringToUTF8(kWebSmartPastePboardType); 381 return base::SysNSStringToUTF8(kWebSmartPastePboardType);
381 } 382 }
382 383
383 } // namespace ui 384 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698