OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 const std::string& serialization) { | 77 const std::string& serialization) { |
78 return FormatType(base::SysUTF8ToNSString(serialization)); | 78 return FormatType(base::SysUTF8ToNSString(serialization)); |
79 } | 79 } |
80 | 80 |
81 Clipboard::Clipboard() { | 81 Clipboard::Clipboard() { |
82 } | 82 } |
83 | 83 |
84 Clipboard::~Clipboard() { | 84 Clipboard::~Clipboard() { |
85 } | 85 } |
86 | 86 |
87 void Clipboard::WriteObjects(const ObjectMap& objects) { | 87 void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { |
| 88 DCHECK_EQ(buffer, BUFFER_STANDARD); |
| 89 |
88 NSPasteboard* pb = GetPasteboard(); | 90 NSPasteboard* pb = GetPasteboard(); |
89 [pb declareTypes:[NSArray array] owner:nil]; | 91 [pb declareTypes:[NSArray array] owner:nil]; |
90 | 92 |
91 for (ObjectMap::const_iterator iter = objects.begin(); | 93 for (ObjectMap::const_iterator iter = objects.begin(); |
92 iter != objects.end(); ++iter) { | 94 iter != objects.end(); ++iter) { |
93 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); | 95 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); |
94 } | 96 } |
95 } | 97 } |
96 | 98 |
97 void Clipboard::WriteText(const char* text_data, size_t text_len) { | 99 void Clipboard::WriteText(const char* text_data, size_t text_len) { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 return type; | 429 return type; |
428 } | 430 } |
429 | 431 |
430 // static | 432 // static |
431 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { | 433 const Clipboard::FormatType& Clipboard::GetWebCustomDataFormatType() { |
432 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kWebCustomDataPboardType)); | 434 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kWebCustomDataPboardType)); |
433 return type; | 435 return type; |
434 } | 436 } |
435 | 437 |
436 } // namespace ui | 438 } // namespace ui |
OLD | NEW |