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

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

Issue 720373003: Add FakeClipboard implementation for unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WINDOWS!!! Created 6 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
« no previous file with comments | « ui/base/clipboard/clipboard_mac.h ('k') | ui/base/clipboard/clipboard_test_template.h » ('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) 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
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
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
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_mac.h ('k') | ui/base/clipboard/clipboard_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698