| OLD | NEW |
| 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 "app/clipboard/clipboard.h" | 7 #include "app/clipboard/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" |
| 11 #include "webkit/api/public/WebImage.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebImage.h" |
| 12 #include "webkit/api/public/WebURL.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
| 13 #include "webkit/glue/webclipboard_impl.h" | 13 #include "webkit/glue/webclipboard_impl.h" |
| 14 #include "webkit/glue/webkit_glue.h" | 14 #include "webkit/glue/webkit_glue.h" |
| 15 | 15 |
| 16 using WebKit::WebString; | 16 using WebKit::WebString; |
| 17 using WebKit::WebURL; | 17 using WebKit::WebURL; |
| 18 | 18 |
| 19 bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { | 19 bool MockWebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) { |
| 20 switch (format) { | 20 switch (format) { |
| 21 case FormatHTML: | 21 case FormatHTML: |
| 22 return !m_htmlText.isEmpty(); | 22 return !m_htmlText.isEmpty(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, | 80 void MockWebClipboardImpl::writeImage(const WebKit::WebImage& image, |
| 81 const WebKit::WebURL& url, const WebKit::WebString& title) { | 81 const WebKit::WebURL& url, const WebKit::WebString& title) { |
| 82 if (!image.isNull()) { | 82 if (!image.isNull()) { |
| 83 m_htmlText = WebString::fromUTF8( | 83 m_htmlText = WebString::fromUTF8( |
| 84 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title)); | 84 webkit_glue::WebClipboardImpl::URLToImageMarkup(url, title)); |
| 85 m_plainText = m_htmlText; | 85 m_plainText = m_htmlText; |
| 86 m_writeSmartPaste = false; | 86 m_writeSmartPaste = false; |
| 87 } | 87 } |
| 88 } | 88 } |
| OLD | NEW |