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

Side by Side Diff: content/browser/devtools/protocol/input_handler.cc

Issue 1146173007: [KeyboardEvent] Cleanup of dispatchKeyEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug227231_devTools
Patch Set: Rebaselined Created 5 years, 6 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 | « content/browser/devtools/protocol/input_handler.h ('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 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 "content/browser/devtools/protocol/input_handler.h" 5 #include "content/browser/devtools/protocol/input_handler.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "cc/output/compositor_frame_metadata.h" 9 #include "cc/output/compositor_frame_metadata.h"
10 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 211 }
212 212
213 if (!host_) 213 if (!host_)
214 return Response::ServerError("Could not connect to view"); 214 return Response::ServerError("Could not connect to view");
215 215
216 host_->Focus(); 216 host_->Focus();
217 host_->ForwardKeyboardEvent(event); 217 host_->ForwardKeyboardEvent(event);
218 return Response::OK(); 218 return Response::OK();
219 } 219 }
220 220
221 Response InputHandler::DispatchKeyEvent(
222 const std::string& type,
223 const int* modifiers,
224 const double* timestamp,
225 const std::string* text,
226 const std::string* unmodified_text,
227 const std::string* key_identifier,
228 const std::string* code,
229 const int* windows_virtual_key_code,
230 const int* native_virtual_key_code,
231 const bool* auto_repeat,
232 const bool* is_keypad,
233 const bool* is_system_key) {
234 std::string dom_key;
235 return InputHandler::DispatchKeyEvent(type, modifiers, timestamp, text,
236 unmodified_text, key_identifier, code, &dom_key,
237 windows_virtual_key_code, native_virtual_key_code, auto_repeat,
238 is_keypad, is_system_key);
239 }
240
241 Response InputHandler::DispatchMouseEvent( 221 Response InputHandler::DispatchMouseEvent(
242 const std::string& type, 222 const std::string& type,
243 int x, 223 int x,
244 int y, 224 int y,
245 const int* modifiers, 225 const int* modifiers,
246 const double* timestamp, 226 const double* timestamp,
247 const std::string* button, 227 const std::string* button,
248 const int* click_count) { 228 const int* click_count) {
249 blink::WebMouseEvent event; 229 blink::WebMouseEvent event;
250 230
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 } else { 463 } else {
484 client_->SendError(command_id, 464 client_->SendError(command_id,
485 Response::InternalError(base::StringPrintf( 465 Response::InternalError(base::StringPrintf(
486 "Synthetic tap failed, result was %d", result))); 466 "Synthetic tap failed, result was %d", result)));
487 } 467 }
488 } 468 }
489 469
490 } // namespace input 470 } // namespace input
491 } // namespace devtools 471 } // namespace devtools
492 } // namespace content 472 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/input_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698