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

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

Issue 8606002: Remove Task inheritance in clipboard code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback from jam Created 9 years 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
59 } 58 }
60 59
61 void Clipboard::WriteText(const char* text_data, size_t text_len) { 60 void Clipboard::WriteText(const char* text_data, size_t text_len) {
62 std::string text_str(text_data, text_len); 61 std::string text_str(text_data, text_len);
63 NSString *text = base::SysUTF8ToNSString(text_str); 62 NSString *text = base::SysUTF8ToNSString(text_str);
64 NSPasteboard* pb = GetPasteboard(); 63 NSPasteboard* pb = GetPasteboard();
65 [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil]; 64 [pb addTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
66 [pb setString:text forType:NSStringPboardType]; 65 [pb setString:text forType:NSStringPboardType];
67 } 66 }
68 67
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 Clipboard::FormatType Clipboard::GetBitmapFormatType() { 374 Clipboard::FormatType Clipboard::GetBitmapFormatType() {
376 return base::SysNSStringToUTF8(NSTIFFPboardType); 375 return base::SysNSStringToUTF8(NSTIFFPboardType);
377 } 376 }
378 377
379 // static 378 // static
380 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() { 379 Clipboard::FormatType Clipboard::GetWebKitSmartPasteFormatType() {
381 return base::SysNSStringToUTF8(kWebSmartPastePboardType); 380 return base::SysNSStringToUTF8(kWebSmartPastePboardType);
382 } 381 }
383 382
384 } // namespace ui 383 } // 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