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

Side by Side Diff: components/test_runner/text_input_controller.cc

Issue 1756763002: 2016-03-02T18:53:01 LayoutPosition Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-04-25T19:02:18 Created 4 years, 8 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 | « no previous file | third_party/WebKit/LayoutTests/editing/selection/image-before-linebreak.html » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/test_runner/text_input_controller.h" 5 #include "components/test_runner/text_input_controller.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "components/test_runner/web_test_proxy.h" 8 #include "components/test_runner/web_test_proxy.h"
9 #include "gin/arguments.h" 9 #include "gin/arguments.h"
10 #include "gin/handle.h" 10 #include "gin/handle.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 return int_array; 214 return int_array;
215 } 215 }
216 216
217 std::vector<int> TextInputController::SelectedRange() { 217 std::vector<int> TextInputController::SelectedRange() {
218 if (!view()->mainFrame()) 218 if (!view()->mainFrame())
219 return std::vector<int>(); 219 return std::vector<int>();
220 220
221 blink::WebRange range = view()->mainFrame()->selectionRange(); 221 blink::WebRange range = view()->mainFrame()->selectionRange();
222 std::vector<int> int_array(2); 222 std::vector<int> int_array(2);
223 int_array[0] = range.startOffset(); 223 if (!range.isNull()) {
224 int_array[1] = range.endOffset(); 224 // editing/selection/5825350-1.html
225 225 int_array[0] = range.startOffset();
226 int_array[1] = range.endOffset();
227 }
226 return int_array; 228 return int_array;
227 } 229 }
228 230
229 std::vector<int> TextInputController::FirstRectForCharacterRange( 231 std::vector<int> TextInputController::FirstRectForCharacterRange(
230 unsigned location, 232 unsigned location,
231 unsigned length) { 233 unsigned length) {
232 blink::WebRect rect; 234 blink::WebRect rect;
233 if (!view()->focusedFrame() || 235 if (!view()->focusedFrame() ||
234 !view()->focusedFrame()->firstRectForCharacterRange(location, length, 236 !view()->focusedFrame()->firstRectForCharacterRange(location, length,
235 rect)) { 237 rect)) {
(...skipping 27 matching lines...) Expand all
263 blink::WebString::fromUTF8(text), 265 blink::WebString::fromUTF8(text),
264 blink::WebVector<blink::WebCompositionUnderline>(underlines), 266 blink::WebVector<blink::WebCompositionUnderline>(underlines),
265 text.length(), text.length()); 267 text.length(), text.length());
266 } 268 }
267 269
268 blink::WebView* TextInputController::view() { 270 blink::WebView* TextInputController::view() {
269 return web_test_proxy_base_->web_view(); 271 return web_test_proxy_base_->web_view();
270 } 272 }
271 273
272 } // namespace test_runner 274 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/editing/selection/image-before-linebreak.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698