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

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

Issue 43593003: Add layout switcher for virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Formatting tweaks. Created 7 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 | Annotate | Revision Log
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" extends="kb-key-base" 7 <polymer-element name="kb-key" extends="kb-key-base"
8 attributes="keyCode shiftModifier weight"> 8 attributes="keyCode shiftModifier weight">
9 <template> 9 <template>
10 <style> 10 <style>
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 break; 70 break;
71 default: 71 default:
72 break; 72 break;
73 } 73 }
74 return detail; 74 return detail;
75 } 75 }
76 }); 76 });
77 </script> 77 </script>
78 </polymer-element> 78 </polymer-element>
79 79
80 <!-- 80 <polymer-element name="kb-hide-keyboard-key" class="hide-keyboard dark"
81 -- TODO(kevers): Rip this out if and when we are done implementing the proper 81 char="Invalid" extends="kb-key">
82 -- layout switcher.
83 -->
84 <polymer-element name="kb-layout-selector" class="layout-selector dark" char="In valid"
85 extends="kb-key">
86 <script>
87 Polymer('kb-layout-selector', {
88 toLayout: 'qwerty'
89 });
90 </script>
91 </polymer-element>
92
93 <polymer-element name="kb-hide-keyboard-key" class="hide-keyboard dark" char="In valid"
94 extends="kb-key">
95 <script> 82 <script>
96 Polymer('kb-hide-keyboard-key', { 83 Polymer('kb-hide-keyboard-key', {
97 down: function(event) {}, 84 /**
85 * Timer for a long press event which triggers the display of a keyboard
86 * options menu.
87 * @type {?Function}
88 */
89 longPressTimer: undefined,
90
91 down: function(event) {
92 var self = this;
93 this.longPressTimer = this.asyncMethod(function() {
94 if (self.longPressTimer) {
95 clearTimeout(self.longPressTimer);
96 self.longPressTimer = undefined;
97 var details = {
98 left: this.offsetLeft,
99 top: this.offsetTop,
100 width: this.clientWidth,
101 };
102 this.fire('show-options', details);
103 }
104 }, null, LONGPRESS_DELAY_MSEC);
105 },
106
98 up: function(event) { 107 up: function(event) {
99 hideKeyboard(); 108 if (this.longPressTimer) {
109 hideKeyboard();
110 this.longPressTimer = undefined;
111 }
100 } 112 }
101 }); 113 });
102 </script> 114 </script>
103 </polymer-element> 115 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698