Index: ui/keyboard/resources/elements/kb-keyboard.html |
diff --git a/ui/keyboard/resources/elements/kb-keyboard.html b/ui/keyboard/resources/elements/kb-keyboard.html |
index c29dac618db3e622129b6ab22bb85da48bbcb6c2..dbc8ab4ee91f1a64600bd0aaafd6875775ea0142 100644 |
--- a/ui/keyboard/resources/elements/kb-keyboard.html |
+++ b/ui/keyboard/resources/elements/kb-keyboard.html |
@@ -212,7 +212,8 @@ |
*/ |
inputTypeToLayoutMap: { |
number: "numeric", |
- text: "qwerty" |
+ text: "qwerty", |
+ password: "system-qwerty" //TODO(rsadam@): Add unit test for this. |
}, |
/** |
@@ -251,12 +252,7 @@ |
var layout = this.inputTypeToLayoutMap[this.inputType]; |
if (!layout) |
layout = this.inputTypeToLayoutMap.text; |
- // Reselects the default keyset if target layout is the same as current |
- // layout. This forces a reset of the keyboard state. |
- if(this.layout == layout) |
- this.selectDefaultKeyset(); |
- else |
- this.layout = layout; |
+ this.layout = layout; |
}, |
/** |
@@ -596,6 +592,26 @@ |
}, |
/** |
+ * The current input type. |
+ * @type {string} |
+ */ |
+ get inputTypeValue() { |
+ return inputType; |
+ }, |
+ |
+ /** |
+ * Changes the input type if it's different from the current |
+ * type, else resets the keyset to the default keyset. |
+ * @type {string} |
+ */ |
+ set inputTypeValue(value) { |
+ if (value == this.inputType) |
+ this.selectDefaultKeyset(); |
+ else |
+ this.inputType = value; |
+ }, |
+ |
+ /** |
* Generates fabricated key events to simulate typing on a |
* physical keyboard. |
* @param {Object} detail Attributes of the key being typed. |