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" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCommon.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCommon.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h" |
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
14 #include "webkit/glue/webclipboard_impl.h" | 15 #include "webkit/glue/webclipboard_impl.h" |
15 #include "webkit/glue/webkit_glue.h" | 16 #include "webkit/glue/webkit_glue.h" |
16 #include "webkit/support/webkit_support_gfx.h" | 17 #include "webkit/support/webkit_support_gfx.h" |
17 | 18 |
18 #if WEBKIT_USING_CG | 19 #if WEBKIT_USING_CG |
19 #include <ApplicationServices/ApplicationServices.h> | 20 #include <ApplicationServices/ApplicationServices.h> |
20 #include <CoreFoundation/CoreFoundation.h> | 21 #include <CoreFoundation/CoreFoundation.h> |
21 #endif | 22 #endif |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, | 152 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, |
152 const WebKit::WebURL& url, const WebKit::WebString& title) { | 153 const WebKit::WebURL& url, const WebKit::WebString& title) { |
153 if (!image.isNull()) { | 154 if (!image.isNull()) { |
154 m_htmlText = WebString::fromUTF8( | 155 m_htmlText = WebString::fromUTF8( |
155 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title)); | 156 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title)); |
156 m_plainText = m_htmlText; | 157 m_plainText = m_htmlText; |
157 m_image = image; | 158 m_image = image; |
158 m_writeSmartPaste = false; | 159 m_writeSmartPaste = false; |
159 } | 160 } |
160 } | 161 } |
| 162 |
| 163 void MockWebClipboardImpl::writeDataObject(const WebKit::WebDragData& data) { |
| 164 m_htmlText = data.htmlText(); |
| 165 m_plainText = data.plainText(); |
| 166 m_image.reset(); |
| 167 m_writeSmartPaste = false; |
| 168 } |
OLD | NEW |