OLD | NEW |
---|---|
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 Loading... | |
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 |
OLD | NEW |