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

Unified Diff: ui/keyboard/resources/elements/kb-keyset.js

Issue 730573002: Remove dead code for system VK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/keyboard/resources/elements/kb-keyset.html ('k') | ui/keyboard/resources/elements/kb-modifier-key.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/resources/elements/kb-keyset.js
diff --git a/ui/keyboard/resources/elements/kb-keyset.js b/ui/keyboard/resources/elements/kb-keyset.js
deleted file mode 100644
index 60a0a015e674b59d801ef8d39a8f83a43889bcd5..0000000000000000000000000000000000000000
--- a/ui/keyboard/resources/elements/kb-keyset.js
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-Polymer('kb-keyset', {
- align: "center",
- // Propagate flick gestures to keys in this keyset.
- flick: true,
- isDefault: false,
- nextKeyset: undefined,
- // Weight offsets for positioning the keyset.
- weightBottom: 15,
- weightLeft: 10,
- weightRight: 10,
- weightTop: 6,
-
- /**
- * Weight assigned to space between keys, of the form "xPitch yPitch".
- * Defaults to xPitch = yPitch if it's only a single number.
- * @type {string}
- */
- pitch: "10",
-
- /**
- * Expands kb-key-sequences into individual keys.
- */
- flattenKeyset: function() {
- var keySequences = this.querySelectorAll('kb-key-sequence');
- if (keySequences.length != 0) {
- keySequences.array().forEach(function(element) {
- var generatedDom = element.generateDom();
- element.parentNode.replaceChild(generatedDom, element);
- });
- }
- },
-
- // TODO(bshe): support select keyset on down, long and dbl events.
- keyUp: function(event, detail) {
- switch (detail.char) {
- case 'Shift':
- case 'Alt':
- case 'Ctrl':
- case 'Invalid':
- return;
- default:
- break;
- }
- if (!detail.toKeyset)
- detail.toKeyset = this.nextKeyset;
- },
- keyLongpress: function(event, detail) {
- if (!detail.char)
- return;
-
- var altkeyContainer = this.$.altkeyContainer.getDistributedNodes()[0];
- if (!altkeyContainer)
- return;
-
- var altkeyMetadata = this.$.altkeyMetadata;
- var altkeys = altkeyMetadata.getAltkeys(detail.char,
- !!detail.hintText);
- if (!altkeys)
- return;
-
- var id = altkeys.id;
- var activeAltKeySet = altkeyContainer.querySelector('#' + id);
- if (!activeAltKeySet) {
- var keyWidth = event.target.clientWidth;
- var leftMargin = event.target.offsetLeft;
- var maxLeftOffset = Math.round(leftMargin / keyWidth);
- var rightMargin = this.clientWidth - leftMargin - keyWidth;
- var maxRightOffset = Math.round(rightMargin / keyWidth);
- activeAltKeySet = altkeyMetadata.createAltkeySet(detail.char,
- maxLeftOffset,
- maxRightOffset,
- detail.hintText);
- altkeyContainer.appendChild(activeAltKeySet);
- }
-
- altkeyContainer.keyset = id;
- event.target.dropKey();
- activeAltKeySet.style.width = event.target.clientWidth *
- activeAltKeySet.childElementCount + 'px';
- activeAltKeySet.style.height = event.target.clientHeight + 'px';
- activeAltKeySet.style.top = event.target.offsetTop + 'px';
- var leftOffset = activeAltKeySet.offset * event.target.clientWidth;
- activeAltKeySet.style.left = event.target.offsetLeft - leftOffset +
- 'px';
- var nodes = activeAltKeySet.childNodes;
- nodes[activeAltKeySet.offset].classList.add('active');
- altkeyContainer.hidden = false;
- },
-
- show: function() {
- var old = $('keyboard').querySelector('.activeKeyset');
- if (old && old != this)
- old.classList.remove('activeKeyset');
- this.classList.add('activeKeyset');
- this.fire('stateChange', {
- state: 'keysetChanged',
- value: this.id
- });
- },
-});
« no previous file with comments | « ui/keyboard/resources/elements/kb-keyset.html ('k') | ui/keyboard/resources/elements/kb-modifier-key.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698