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

Side by Side Diff: ui/base/clipboard/clipboard_win.cc

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_win.h ('k') | ui/base/test/test_clipboard.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 // Many of these functions are based on those found in 5 // Many of these functions are based on those found in
6 // webkit/port/platform/PasteboardWin.cpp 6 // webkit/port/platform/PasteboardWin.cpp
7 7
8 #include "ui/base/clipboard/clipboard_win.h" 8 #include "ui/base/clipboard/clipboard_win.h"
9 9
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 // ClipboardWin implementation. 382 // ClipboardWin implementation.
383 ClipboardWin::ClipboardWin() { 383 ClipboardWin::ClipboardWin() {
384 if (base::MessageLoopForUI::IsCurrent()) 384 if (base::MessageLoopForUI::IsCurrent())
385 clipboard_owner_.reset(new base::win::MessageWindow()); 385 clipboard_owner_.reset(new base::win::MessageWindow());
386 } 386 }
387 387
388 ClipboardWin::~ClipboardWin() { 388 ClipboardWin::~ClipboardWin() {
389 } 389 }
390 390
391 uint64 ClipboardWin::GetSequenceNumber(ClipboardType type) { 391 uint64 ClipboardWin::GetSequenceNumber(ClipboardType type) const {
392 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); 392 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
393 return ::GetClipboardSequenceNumber(); 393 return ::GetClipboardSequenceNumber();
394 } 394 }
395 395
396 bool ClipboardWin::IsFormatAvailable(const Clipboard::FormatType& format, 396 bool ClipboardWin::IsFormatAvailable(const Clipboard::FormatType& format,
397 ClipboardType type) const { 397 ClipboardType type) const {
398 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE); 398 DCHECK_EQ(type, CLIPBOARD_TYPE_COPY_PASTE);
399 return ::IsClipboardFormatAvailable(format.ToFormatEtc().cfFormat) != FALSE; 399 return ::IsClipboardFormatAvailable(format.ToFormatEtc().cfFormat) != FALSE;
400 } 400 }
401 401
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 if (!clipboard_owner_) 853 if (!clipboard_owner_)
854 return NULL; 854 return NULL;
855 855
856 if (clipboard_owner_->hwnd() == NULL) 856 if (clipboard_owner_->hwnd() == NULL)
857 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc)); 857 clipboard_owner_->Create(base::Bind(&ClipboardOwnerWndProc));
858 858
859 return clipboard_owner_->hwnd(); 859 return clipboard_owner_->hwnd();
860 } 860 }
861 861
862 } // namespace ui 862 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_win.h ('k') | ui/base/test/test_clipboard.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698