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

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

Issue 2120153003: Remove keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_key_identifier_3a
Patch Set: Rebase Created 4 years, 5 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
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 return int_array; 247 return int_array;
248 } 248 }
249 249
250 void TextInputController::SetComposition(const std::string& text) { 250 void TextInputController::SetComposition(const std::string& text) {
251 // Sends a keydown event with key code = 0xE5 to emulate input method 251 // Sends a keydown event with key code = 0xE5 to emulate input method
252 // behavior. 252 // behavior.
253 blink::WebKeyboardEvent key_down; 253 blink::WebKeyboardEvent key_down;
254 key_down.type = blink::WebInputEvent::RawKeyDown; 254 key_down.type = blink::WebInputEvent::RawKeyDown;
255 key_down.modifiers = 0; 255 key_down.modifiers = 0;
256 key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY 256 key_down.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
257 key_down.setKeyIdentifierFromWindowsKeyCode();
258 view()->handleInputEvent(key_down); 257 view()->handleInputEvent(key_down);
259 258
260 std::vector<blink::WebCompositionUnderline> underlines; 259 std::vector<blink::WebCompositionUnderline> underlines;
261 underlines.push_back(blink::WebCompositionUnderline(0, text.length(), 260 underlines.push_back(blink::WebCompositionUnderline(0, text.length(),
262 SK_ColorBLACK, false, 261 SK_ColorBLACK, false,
263 SK_ColorTRANSPARENT)); 262 SK_ColorTRANSPARENT));
264 view()->setComposition( 263 view()->setComposition(
265 blink::WebString::fromUTF8(text), 264 blink::WebString::fromUTF8(text),
266 blink::WebVector<blink::WebCompositionUnderline>(underlines), 265 blink::WebVector<blink::WebCompositionUnderline>(underlines),
267 text.length(), text.length()); 266 text.length(), text.length());
268 } 267 }
269 268
270 blink::WebView* TextInputController::view() { 269 blink::WebView* TextInputController::view() {
271 return web_test_proxy_base_->web_view(); 270 return web_test_proxy_base_->web_view();
272 } 271 }
273 272
274 } // namespace test_runner 273 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | content/browser/devtools/protocol/devtools_protocol_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698