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

Side by Side Diff: webkit/tools/test_shell/mock_webclipboard_impl.cc

Issue 211052: Implement ChromiumBridge::clipboardWritePlainText() (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months 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 | « webkit/tools/test_shell/mock_webclipboard_impl.h ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" 5 #include "webkit/tools/test_shell/mock_webclipboard_impl.h"
6 6
7 #include "base/clipboard.h" 7 #include "base/clipboard.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/escape.h" 10 #include "net/base/escape.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 57
58 void MockWebClipboardImpl::writeHTML( 58 void MockWebClipboardImpl::writeHTML(
59 const WebKit::WebString& htmlText, const WebKit::WebURL& url, 59 const WebKit::WebString& htmlText, const WebKit::WebURL& url,
60 const WebKit::WebString& plainText, bool writeSmartPaste) { 60 const WebKit::WebString& plainText, bool writeSmartPaste) {
61 m_htmlText = htmlText; 61 m_htmlText = htmlText;
62 m_plainText = plainText; 62 m_plainText = plainText;
63 m_writeSmartPaste = writeSmartPaste; 63 m_writeSmartPaste = writeSmartPaste;
64 } 64 }
65 65
66 void MockWebClipboardImpl::writePlainText(const WebKit::WebString& plain_text) {
67 m_htmlText = WebKit::WebString();
68 m_plainText = plain_text;
69 m_writeSmartPaste = false;
70 }
71
66 void MockWebClipboardImpl::writeURL( 72 void MockWebClipboardImpl::writeURL(
67 const WebKit::WebURL& url, const WebKit::WebString& title) { 73 const WebKit::WebURL& url, const WebKit::WebString& title) {
68 m_htmlText = WebString::fromUTF8( 74 m_htmlText = WebString::fromUTF8(
69 webkit_glue::WebClipboardImpl::URLToMarkup(url, title)); 75 webkit_glue::WebClipboardImpl::URLToMarkup(url, title));
70 m_plainText = url.spec().utf16(); 76 m_plainText = url.spec().utf16();
71 m_writeSmartPaste = false; 77 m_writeSmartPaste = false;
72 } 78 }
73 79
74 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, 80 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image,
75 const WebKit::WebURL& url, const WebKit::WebString& title) { 81 const WebKit::WebURL& url, const WebKit::WebString& title) {
76 if (!image.isNull()) { 82 if (!image.isNull()) {
77 m_htmlText = WebString::fromUTF8( 83 m_htmlText = WebString::fromUTF8(
78 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title)); 84 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title));
79 m_plainText = m_htmlText; 85 m_plainText = m_htmlText;
80 m_writeSmartPaste = false; 86 m_writeSmartPaste = false;
81 } 87 }
82 } 88 }
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/mock_webclipboard_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698