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

Side by Side Diff: webkit/glue/webclipboard_impl.cc

Issue 8305012: Remove deprecated WebClipboard::readHTML method. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 9 years, 2 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
« no previous file with comments | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | 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) 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/glue/webclipboard_impl.h" 5 #include "webkit/glue/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 "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 buffer_type)) { 112 buffer_type)) {
113 std::string text; 113 std::string text;
114 ClipboardReadAsciiText(buffer_type, &text); 114 ClipboardReadAsciiText(buffer_type, &text);
115 if (!text.empty()) 115 if (!text.empty())
116 return ASCIIToUTF16(text); 116 return ASCIIToUTF16(text);
117 } 117 }
118 118
119 return WebString(); 119 return WebString();
120 } 120 }
121 121
122 // TODO(dcheng): For backwards compatibility during the transition.
123 WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url) {
124 ui::Clipboard::Buffer buffer_type;
125 if (!ConvertBufferType(buffer, &buffer_type))
126 return WebString();
127
128 string16 html_stdstr;
129 GURL gurl;
130 uint32 fragment_start = 0;
131 uint32 fragment_end = 0;
132 ClipboardReadHTML(buffer_type, &html_stdstr, &gurl, &fragment_start,
133 &fragment_end);
134 if (fragment_start != std::string::npos && fragment_end != std::string::npos)
135 return html_stdstr.substr(fragment_start, fragment_end - fragment_start);
136 return WebString();
137 }
138
139 WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url, 122 WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url,
140 unsigned* fragment_start, 123 unsigned* fragment_start,
141 unsigned* fragment_end) { 124 unsigned* fragment_end) {
142 ui::Clipboard::Buffer buffer_type; 125 ui::Clipboard::Buffer buffer_type;
143 if (!ConvertBufferType(buffer, &buffer_type)) 126 if (!ConvertBufferType(buffer, &buffer_type))
144 return WebString(); 127 return WebString();
145 128
146 string16 html_stdstr; 129 string16 html_stdstr;
147 GURL gurl; 130 GURL gurl;
148 ClipboardReadHTML(buffer_type, &html_stdstr, &gurl, 131 ClipboardReadHTML(buffer_type, &html_stdstr, &gurl,
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 break; 257 break;
275 #endif 258 #endif
276 default: 259 default:
277 NOTREACHED(); 260 NOTREACHED();
278 return false; 261 return false;
279 } 262 }
280 return true; 263 return true;
281 } 264 }
282 265
283 } // namespace webkit_glue 266 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698