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

Side by Side Diff: ui/keyboard/resources/elements/kb-key-sequence.html

Issue 26258003: Add a full QWERTY layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix edge case in WebUI Created 7 years, 2 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 <!-- 1 <!--
2 -- Copyright 2013 The Chromium Authors. All rights reserved. 2 -- Copyright 2013 The Chromium Authors. All rights reserved.
3 -- Use of this source code is governed by a BSD-style license that can be 3 -- Use of this source code is governed by a BSD-style license that can be
4 -- found in the LICENSE file. 4 -- found in the LICENSE file.
5 --> 5 -->
6 6
7 <polymer-element name="kb-key-sequence" attributes="keys hintTexts keyCodes"> 7 <polymer-element name="kb-key-sequence"
8 attributes="keys hintTexts keyCodes invert">
8 <template> 9 <template>
9 <style> 10 <style>
10 @host { 11 @host {
11 * { 12 * {
12 display: none; 13 display: none;
13 } 14 }
14 } 15 }
15 </style> 16 </style>
16 <kb-key-codes id="keyCodeMetadata"></kb-key-codes> 17 <kb-key-codes id="keyCodeMetadata"></kb-key-codes>
17 </template> 18 </template>
(...skipping 16 matching lines...) Expand all
34 console.error('keys and keyCodes do not match'); 35 console.error('keys and keyCodes do not match');
35 return; 36 return;
36 } 37 }
37 var replacement = document.createDocumentFragment(); 38 var replacement = document.createDocumentFragment();
38 for (var i = 0; i < newKeys.length; i++) { 39 for (var i = 0; i < newKeys.length; i++) {
39 var key = document.createElement('kb-key'); 40 var key = document.createElement('kb-key');
40 key.innerText = newKeys[i]; 41 key.innerText = newKeys[i];
41 key.accents = newKeys[i]; 42 key.accents = newKeys[i];
42 if (newHintTexts) 43 if (newHintTexts)
43 key.hintText = newHintTexts[i]; 44 key.hintText = newHintTexts[i];
45 var keyCodeIndex = keyCodes[i];
46
47 if (this.invert) {
48 key.invert = true;
49 key.char = newKeys[i];
50 keyCodeIndex = key.hintText;
51 }
44 var state = this.$.keyCodeMetadata.GetKeyCodeAndModifiers( 52 var state = this.$.keyCodeMetadata.GetKeyCodeAndModifiers(
45 keyCodes[i]); 53 keyCodeIndex);
46 if (state) { 54 if (state) {
47 key.keyCode = state.keyCode; 55 key.keyCode = state.keyCode;
48 key.shiftModifier = state.shiftModifier; 56 key.shiftModifier = state.shiftModifier;
49 } 57 }
50 replacement.appendChild(key); 58 replacement.appendChild(key);
51 } 59 }
52 result = replacement; 60 result = replacement;
53 } 61 }
54 return result; 62 return result;
55 } 63 }
56 }); 64 });
57 </script> 65 </script>
58 </polymer-element> 66 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698