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

Side by Side Diff: content/browser/renderer_host/web_input_event_aura.cc

Issue 1348843002: Revert of [KeyEvent Mac] Move WebInputEventFactory into chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/web_input_event_aura.h" 5 #include "content/browser/renderer_host/web_input_event_aura.h"
6 6
7 #include "content/browser/renderer_host/input/web_input_event_util.h" 7 #include "content/browser/renderer_host/input/web_input_event_util.h"
8 #include "content/browser/renderer_host/ui_events_helper.h" 8 #include "content/browser/renderer_host/ui_events_helper.h"
9 #include "ui/aura/client/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 15 matching lines...) Expand all
26 aura::client::ScreenPositionClient* spc = 26 aura::client::ScreenPositionClient* spc =
27 aura::client::GetScreenPositionClient(root); 27 aura::client::GetScreenPositionClient(root);
28 if (!spc) 28 if (!spc)
29 return event.root_location(); 29 return event.root_location();
30 30
31 gfx::Point screen_location(event.root_location()); 31 gfx::Point screen_location(event.root_location());
32 spc->ConvertPointToScreen(root, &screen_location); 32 spc->ConvertPointToScreen(root, &screen_location);
33 return screen_location; 33 return screen_location;
34 } 34 }
35 35
36 blink::WebInputEvent::Modifiers DomCodeToWebInputEventModifiers(
37 ui::DomCode code) {
38 switch (ui::KeycodeConverter::DomCodeToLocation(code)) {
39 case ui::DomKeyLocation::LEFT:
40 return blink::WebInputEvent::IsLeft;
41 case ui::DomKeyLocation::RIGHT:
42 return blink::WebInputEvent::IsRight;
43 case ui::DomKeyLocation::NUMPAD:
44 return blink::WebInputEvent::IsKeyPad;
45 case ui::DomKeyLocation::STANDARD:
46 break;
47 }
48 return static_cast<blink::WebInputEvent::Modifiers>(0);
49 }
50
36 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType( 51 blink::WebPointerProperties::PointerType EventPointerTypeToWebPointerType(
37 ui::EventPointerType pointer_type) { 52 ui::EventPointerType pointer_type) {
38 switch (pointer_type) { 53 switch (pointer_type) {
39 case ui::EventPointerType::POINTER_TYPE_UNKNOWN: 54 case ui::EventPointerType::POINTER_TYPE_UNKNOWN:
40 return blink::WebPointerProperties::PointerType::PointerTypeUnknown; 55 return blink::WebPointerProperties::PointerType::PointerTypeUnknown;
41 case ui::EventPointerType::POINTER_TYPE_MOUSE: 56 case ui::EventPointerType::POINTER_TYPE_MOUSE:
42 return blink::WebPointerProperties::PointerType::PointerTypeMouse; 57 return blink::WebPointerProperties::PointerType::PointerTypeMouse;
43 case ui::EventPointerType::POINTER_TYPE_PEN: 58 case ui::EventPointerType::POINTER_TYPE_PEN:
44 return blink::WebPointerProperties::PointerType::PointerTypePen; 59 return blink::WebPointerProperties::PointerType::PointerTypePen;
45 case ui::EventPointerType::POINTER_TYPE_TOUCH: 60 case ui::EventPointerType::POINTER_TYPE_TOUCH:
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 webkit_event.tiltX = roundf(event.pointer_details().tilt_x()); 429 webkit_event.tiltX = roundf(event.pointer_details().tilt_x());
415 webkit_event.tiltY = roundf(event.pointer_details().tilt_y()); 430 webkit_event.tiltY = roundf(event.pointer_details().tilt_y());
416 webkit_event.force = event.pointer_details().force(); 431 webkit_event.force = event.pointer_details().force();
417 webkit_event.pointerType = 432 webkit_event.pointerType =
418 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type()); 433 EventPointerTypeToWebPointerType(event.pointer_details().pointer_type());
419 434
420 return webkit_event; 435 return webkit_event;
421 } 436 }
422 437
423 } // namespace content 438 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698