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

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

Issue 1337503002: Add blink embedder APIs for DomKey conversion. (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
« no previous file with comments | « content/child/blink_platform_impl.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/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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) { 1367 WebString BlinkPlatformImpl::domCodeStringFromEnum(int dom_code) {
1368 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString( 1368 return WebString::fromUTF8(ui::KeycodeConverter::DomCodeToCodeString(
1369 static_cast<ui::DomCode>(dom_code))); 1369 static_cast<ui::DomCode>(dom_code)));
1370 } 1370 }
1371 1371
1372 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) { 1372 int BlinkPlatformImpl::domEnumFromCodeString(const WebString& code) {
1373 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode( 1373 return static_cast<int>(ui::KeycodeConverter::CodeStringToDomCode(
1374 code.utf8().data())); 1374 code.utf8().data()));
1375 } 1375 }
1376 1376
1377 WebString BlinkPlatformImpl::domKeyStringFromEnum(int dom_key) {
1378 return WebString::fromUTF8(ui::KeycodeConverter::DomKeyToKeyString(
1379 static_cast<ui::DomKey>(dom_key)));
piman 2015/09/10 18:27:40 nit: do we need a range check to make sure this st
kpschoedel 2015/09/10 18:41:30 I can answer this: |ui::DomKey| is explicitly desi
1380 }
1381
1382 int BlinkPlatformImpl::domKeyEnumFromString(const WebString& key_string) {
1383 return static_cast<int>(
1384 ui::KeycodeConverter::KeyStringToDomKey(key_string.utf8().data()));
1385 }
1386
1377 } // namespace content 1387 } // namespace content
OLDNEW
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698