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

Unified 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: Fix keyboard tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/keyboard/resources/elements/kb-keyboard.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/resources/elements/kb-key.html
diff --git a/ui/keyboard/resources/elements/kb-key.html b/ui/keyboard/resources/elements/kb-key.html
index bc1011a90c9d92a38f37dea6359ffd5942d73e27..6edac3744d9eaeeee4e13db1894ce0157373983c 100644
--- a/ui/keyboard/resources/elements/kb-key.html
+++ b/ui/keyboard/resources/elements/kb-key.html
@@ -77,26 +77,39 @@
</script>
</polymer-element>
-<!--
- -- TODO(kevers): Rip this out if and when we are done implementing the proper
- -- layout switcher.
- -->
-<polymer-element name="kb-layout-selector" class="layout-selector dark" char="Invalid"
- extends="kb-key">
- <script>
- Polymer('kb-layout-selector', {
- toLayout: 'qwerty'
- });
- </script>
-</polymer-element>
-
-<polymer-element name="kb-hide-keyboard-key" class="hide-keyboard dark" char="Invalid"
- extends="kb-key">
+<polymer-element name="kb-hide-keyboard-key" class="hide-keyboard dark"
+ char="Invalid" extends="kb-key">
<script>
Polymer('kb-hide-keyboard-key', {
- down: function(event) {},
+ /**
+ * Timer for a long press event which triggers the display of a keyboard
+ * options menu.
+ * @type {?Function}
+ */
+ longPressTimer: undefined,
+
+ down: function(event) {
+ var self = this;
+ this.longPressTimer = this.asyncMethod(function() {
+ if (self.longPressTimer) {
+ clearTimeout(self.longPressTimer);
+ self.longPressTimer = undefined;
+ var details = {
+ left: this.offsetLeft,
+ top: this.offsetTop,
+ width: this.clientWidth,
+ };
+ this.fire('show-options', details);
+ }
+ }, null, LONGPRESS_DELAY_MSEC);
+ },
+
up: function(event) {
- hideKeyboard();
+ if (this.longPressTimer) {
+ clearTimeout(this.longPressTimer);
+ hideKeyboard();
+ this.longPressTimer = undefined;
+ }
}
});
</script>
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/keyboard/resources/elements/kb-keyboard.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698