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

Side by Side Diff: ui/keyboard/resources/elements/kb-altkey.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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * Filter out mouse/touch movements internal to this node. When moving
7 * inside a node, the event should be filter out.
8 * @param {Node} node The accent key node which receives event.
9 * @param {event} event A pointer move event.
10 * @return {boolean} True if event is external to node.
11 */
12 function isRelevantEvent(node, event) {
13 return !(node.compareDocumentPosition(event.relatedTarget)
14 & Node.DOCUMENT_POSITION_CONTAINED_BY);
15 };
16 Polymer('kb-altkey', {
17 over: function(event) {
18 if (isRelevantEvent(this, event)) {
19 // Dragging over an accent key is equivalent to pressing on the accent
20 // key.
21 this.fire('key-down', {});
22 }
23 },
24
25 out: function(event) {
26 if (isRelevantEvent(this, event)) {
27 this.classList.remove('active');
28 }
29 },
30
31 up: function(event) {
32 var detail = {
33 char: this.charValue
34 };
35 this.fire('key-up', detail);
36 },
37
38 // TODO(bshe): kb-altkey should extend from kb-key-base.
39 autoRelease: function() {
40 },
41
42 /**
43 * Character value associated with the key. Typically, the value is a
44 * single character, but may be multi-character in cases like a ".com"
45 * button.
46 * @return {string}
47 */
48 get charValue() {
49 return this.char || this.textContent;
50 }
51 });
52
OLDNEW
« no previous file with comments | « ui/keyboard/resources/elements/kb-altkey.html ('k') | ui/keyboard/resources/elements/kb-altkey-container.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698