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

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

Issue 6724010: Pepper/Flapper: Add IsFormatAvailable() to PPB_Flash_Clipboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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/plugins/ppapi/ppb_flash_clipboard_impl.cc ('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) 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
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 }
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_flash_clipboard_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698