| 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_mac.h" | 5 #include "ui/base/clipboard/clipboard_mac.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/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 // ClipboardMac implementation. | 178 // ClipboardMac implementation. |
| 179 ClipboardMac::ClipboardMac() { | 179 ClipboardMac::ClipboardMac() { |
| 180 DCHECK(CalledOnValidThread()); | 180 DCHECK(CalledOnValidThread()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 ClipboardMac::~ClipboardMac() { | 183 ClipboardMac::~ClipboardMac() { |
| 184 DCHECK(CalledOnValidThread()); | 184 DCHECK(CalledOnValidThread()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 uint64 ClipboardMac::GetSequenceNumber(ClipboardType type) { | 187 uint64 ClipboardMac::GetSequenceNumber(ClipboardType type) const { |
| 188 DCHECK(CalledOnValidThread()); | 188 DCHECK(CalledOnValidThread()); |
| 189 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); | 189 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); |
| 190 | 190 |
| 191 NSPasteboard* pb = GetPasteboard(); | 191 NSPasteboard* pb = GetPasteboard(); |
| 192 return [pb changeCount]; | 192 return [pb changeCount]; |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool ClipboardMac::IsFormatAvailable(const FormatType& format, | 195 bool ClipboardMac::IsFormatAvailable(const FormatType& format, |
| 196 ClipboardType type) const { | 196 ClipboardType type) const { |
| 197 DCHECK(CalledOnValidThread()); | 197 DCHECK(CalledOnValidThread()); |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 // Write an extra flavor that signifies WebKit was the last to modify the | 448 // Write an extra flavor that signifies WebKit was the last to modify the |
| 449 // pasteboard. This flavor has no data. | 449 // pasteboard. This flavor has no data. |
| 450 void ClipboardMac::WriteWebSmartPaste() { | 450 void ClipboardMac::WriteWebSmartPaste() { |
| 451 NSPasteboard* pb = GetPasteboard(); | 451 NSPasteboard* pb = GetPasteboard(); |
| 452 NSString* format = GetWebKitSmartPasteFormatType().ToNSString(); | 452 NSString* format = GetWebKitSmartPasteFormatType().ToNSString(); |
| 453 [pb addTypes:[NSArray arrayWithObject:format] owner:nil]; | 453 [pb addTypes:[NSArray arrayWithObject:format] owner:nil]; |
| 454 [pb setData:nil forType:format]; | 454 [pb setData:nil forType:format]; |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace ui | 457 } // namespace ui |
| OLD | NEW |