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

Side by Side Diff: content/child/blink_platform_impl.cc

Issue 929053004: [KeyboardEvent] Add embedder APIs to translate between Dom |key| enum and strings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "API has been updated on the blink side" Created 5 years, 9 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 "content/child/blink_platform_impl.h" 5 #include "content/child/blink_platform_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) { 1268 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) {
1269 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1269 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1270 static_cast<ui::DomCode>(dom_code))); 1270 static_cast<ui::DomCode>(dom_code)));
1271 } 1271 }
1272 1272
1273 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1273 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1274 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1274 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1275 code.utf8().data())); 1275 code.utf8().data()));
1276 } 1276 }
1277 1277
1278 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) {
1279 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1280 static_cast<ui::DomKey>(dom_key)));
Wez 2015/04/21 02:25:58 nit: Strictly speaking the behaviour of static_cas
Habib Virji 2015/04/29 16:05:18 Right wez,this issue was discussed in domCodeStrin
1281 }
1282
1283 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key) {
1284 return static_cast<int>(ui::KeycodeConverter::KeyStringToDomKey(
1285 key.utf8().data()));
1286 }
1287
1278 } // namespace content 1288 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698