OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_util.h" | 8 #include "base/string_util.h" |
9 #include "net/base/escape.h" | 9 #include "net/base/escape.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" |
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
12 #include "webkit/glue/webclipboard_impl.h" | 12 #include "webkit/glue/webclipboard_impl.h" |
13 #include "webkit/glue/webkit_glue.h" | 13 #include "webkit/glue/webkit_glue.h" |
14 | 14 |
15 using WebKit::WebString; | 15 using WebKit::WebString; |
16 using WebKit::WebURL; | 16 using WebKit::WebURL; |
17 using WebKit::WebVector; | 17 using WebKit::WebVector; |
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 FormatPlainText: |
| 22 return !m_plainText.isEmpty(); |
| 23 |
21 case FormatHTML: | 24 case FormatHTML: |
22 return !m_htmlText.isEmpty(); | 25 return !m_htmlText.isEmpty(); |
23 | 26 |
24 case FormatSmartPaste: | 27 case FormatSmartPaste: |
25 return m_writeSmartPaste; | 28 return m_writeSmartPaste; |
26 | 29 |
27 default: | 30 default: |
28 NOTREACHED(); | 31 NOTREACHED(); |
29 return false; | 32 return false; |
30 } | 33 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 *containsFilenames = false; | 95 *containsFilenames = false; |
93 std::vector<WebString> results; | 96 std::vector<WebString> results; |
94 if (!m_plainText.isEmpty()) { | 97 if (!m_plainText.isEmpty()) { |
95 results.push_back(WebString("text/plain")); | 98 results.push_back(WebString("text/plain")); |
96 } | 99 } |
97 if (!m_htmlText.isEmpty()) { | 100 if (!m_htmlText.isEmpty()) { |
98 results.push_back(WebString("text/html")); | 101 results.push_back(WebString("text/html")); |
99 } | 102 } |
100 return results; | 103 return results; |
101 } | 104 } |
OLD | NEW |