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

Side by Side Diff: content/renderer/pepper/event_conversion.cc

Issue 1480303002: Implement a basic PPAPI plugin for Blink layout tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address codereview comment and try to fix Mac Created 5 years 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/public/test/ppapi_test_utils.cc ('k') | content/shell/BUILD.gn » ('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) 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/renderer/pepper/event_conversion.h" 5 #include "content/renderer/pepper/event_conversion.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/i18n/char_iterator.h" 8 #include "base/i18n/char_iterator.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 return result; 128 return result;
129 } 129 }
130 130
131 void AppendKeyEvent(const WebInputEvent& event, 131 void AppendKeyEvent(const WebInputEvent& event,
132 std::vector<InputEventData>* result_events) { 132 std::vector<InputEventData>* result_events) {
133 const WebKeyboardEvent& key_event = 133 const WebKeyboardEvent& key_event =
134 static_cast<const WebKeyboardEvent&>(event); 134 static_cast<const WebKeyboardEvent&>(event);
135 InputEventData result = GetEventWithCommonFieldsAndType(event); 135 InputEventData result = GetEventWithCommonFieldsAndType(event);
136 result.event_modifiers = key_event.modifiers; 136 result.event_modifiers = key_event.modifiers;
137 result.key_code = key_event.windowsKeyCode; 137 result.key_code = key_event.windowsKeyCode;
138 #if defined(OS_MACOSX)
139 // Workaround for |domCode| not being set on OS X. crbug.com/493833
dcheng 2015/12/01 23:51:17 I think this should fix the Mac test... hopefully.
140 result.code = ui::KeycodeConverter::DomCodeToCodeString(
141 ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.nativeKeyCode));
142 #else
143 result.code = ui::KeycodeConverter::DomCodeToCodeString( 138 result.code = ui::KeycodeConverter::DomCodeToCodeString(
144 static_cast<ui::DomCode>(key_event.domCode)); 139 static_cast<ui::DomCode>(key_event.domCode));
145 #endif
146 result_events->push_back(result); 140 result_events->push_back(result);
147 } 141 }
148 142
149 void AppendCharEvent(const WebInputEvent& event, 143 void AppendCharEvent(const WebInputEvent& event,
150 std::vector<InputEventData>* result_events) { 144 std::vector<InputEventData>* result_events) {
151 const WebKeyboardEvent& key_event = 145 const WebKeyboardEvent& key_event =
152 static_cast<const WebKeyboardEvent&>(event); 146 static_cast<const WebKeyboardEvent&>(event);
153 147
154 // This is a bit complex, the input event will normally just have one 16-bit 148 // This is a bit complex, the input event will normally just have one 16-bit
155 // character in it, but may be zero or more than one. The text array is 149 // character in it, but may be zero or more than one. The text array is
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 case WebInputEvent::TouchStart: 743 case WebInputEvent::TouchStart:
750 return PP_INPUTEVENT_CLASS_TOUCH; 744 return PP_INPUTEVENT_CLASS_TOUCH;
751 case WebInputEvent::Undefined: 745 case WebInputEvent::Undefined:
752 default: 746 default:
753 CHECK(WebInputEvent::isGestureEventType(type)); 747 CHECK(WebInputEvent::isGestureEventType(type));
754 return PP_InputEvent_Class(0); 748 return PP_InputEvent_Class(0);
755 } 749 }
756 } 750 }
757 751
758 } // namespace content 752 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/ppapi_test_utils.cc ('k') | content/shell/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698