OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/mock_webclipboard_impl.h" | 5 #include "webkit/tools/test_shell/mock_webclipboard_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return true; | 61 return true; |
62 } | 62 } |
63 | 63 |
64 WebKit::WebString MockWebClipboardImpl::readPlainText( | 64 WebKit::WebString MockWebClipboardImpl::readPlainText( |
65 WebKit::WebClipboard::Buffer buffer) { | 65 WebKit::WebClipboard::Buffer buffer) { |
66 return m_plainText; | 66 return m_plainText; |
67 } | 67 } |
68 | 68 |
69 // TODO(wtc): set output argument *url. | 69 // TODO(wtc): set output argument *url. |
70 WebKit::WebString MockWebClipboardImpl::readHTML( | 70 WebKit::WebString MockWebClipboardImpl::readHTML( |
71 WebKit::WebClipboard::Buffer buffer, WebKit::WebURL* url) { | |
72 return m_htmlText; | |
73 } | |
74 | |
75 WebKit::WebString MockWebClipboardImpl::readHTML( | |
76 WebKit::WebClipboard::Buffer buffer, WebKit::WebURL* url, | 71 WebKit::WebClipboard::Buffer buffer, WebKit::WebURL* url, |
77 unsigned* fragmentStart, unsigned* fragmentEnd) { | 72 unsigned* fragmentStart, unsigned* fragmentEnd) { |
78 *fragmentStart = 0; | 73 *fragmentStart = 0; |
79 *fragmentEnd = static_cast<unsigned>(m_htmlText.length()); | 74 *fragmentEnd = static_cast<unsigned>(m_htmlText.length()); |
80 return m_htmlText; | 75 return m_htmlText; |
81 } | 76 } |
82 | 77 |
83 WebKit::WebData MockWebClipboardImpl::readImage( | 78 WebKit::WebData MockWebClipboardImpl::readImage( |
84 WebKit::WebClipboard::Buffer buffer) { | 79 WebKit::WebClipboard::Buffer buffer) { |
85 std::string data; | 80 std::string data; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 results.push_back(WebString("text/plain")); | 151 results.push_back(WebString("text/plain")); |
157 } | 152 } |
158 if (!m_htmlText.isEmpty()) { | 153 if (!m_htmlText.isEmpty()) { |
159 results.push_back(WebString("text/html")); | 154 results.push_back(WebString("text/html")); |
160 } | 155 } |
161 if (!m_image.isNull()) { | 156 if (!m_image.isNull()) { |
162 results.push_back(WebString("image/png")); | 157 results.push_back(WebString("image/png")); |
163 } | 158 } |
164 return results; | 159 return results; |
165 } | 160 } |
OLD | NEW |