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

Unified Diff: chrome/browser/resources/vr_shell/vr_shell_ui.js

Issue 2670833005: Improve VR omnibox styling and function (Closed)
Patch Set: Created 3 years, 11 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
Index: chrome/browser/resources/vr_shell/vr_shell_ui.js
diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui.js b/chrome/browser/resources/vr_shell/vr_shell_ui.js
index d177a88dbe9ee2ac019870481f956fa29ee16a08..00b52eb4c46880e1391ded608de565ae9f8a5685 100644
--- a/chrome/browser/resources/vr_shell/vr_shell_ui.js
+++ b/chrome/browser/resources/vr_shell/vr_shell_ui.js
@@ -210,6 +210,9 @@ var vrShellUi = (function() {
let update = new api.UiElementUpdate();
update.setVisible(false);
+ update.setSize(0.5, 0.2, 1);
+ update.setTranslation(0, -2, -1);
+ update.setRotation(1, 0, 0, -0.8);
ui.updateElement(this.uiElement.uiElementId, update);
}
@@ -496,6 +499,7 @@ var vrShellUi = (function() {
// Watch for the enter key to trigger navigation.
this.inputField.addEventListener('keypress', function(e) {
if (e.keyCode == 13) {
+ this.setSuggestions([]);
api.doAction(
// TODO(crbug.com/683344): Properly choose prefix.
api.Action.LOAD_URL, {'url': 'http://' + e.target.value});
@@ -508,15 +512,17 @@ var vrShellUi = (function() {
});
// Clicking on suggestions triggers navigation.
- let elements = root.querySelectorAll('.omnibox-suggestion');
+ let elements = root.querySelectorAll('.suggestion');
this.maxSuggestions = elements.length;
for (var i = 0; i < elements.length; i++) {
elements[i].addEventListener('click', function(index, e) {
if (e.target.url) {
api.doAction(api.Action.LOAD_URL, {'url': e.target.url});
+ this.setSuggestions([]);
}
}.bind(this, i));
}
+
}
setEnabled(enabled) {

Powered by Google App Engine
This is Rietveld 408576698