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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js

Issue 2621773003: Fix ISearch regressions (Closed)
Patch Set: Select search query when re-focused 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/chromeos/chromevox/cvox2/background/panel.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
index 4d6a4d7c3caa50e85d10293f86d0c48a679198b3..acdf95a4fa22743262473e59c712c6817f595026 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/panel.js
@@ -36,6 +36,17 @@ Panel.Mode = {
};
/**
+ * A callback function to be executed to perform the action from selecting
+ * a menu item after the menu has been closed and focus has been restored
+ * to the page or wherever it was previously.
+ * @param {?Function} callback
+ */
+Panel.setPendingCallback = function(callback) {
+ /** @type {?Function} @private */
+ Panel.pendingCallback_ = callback;
+};
+
+/**
* Initialize the panel.
*/
Panel.init = function() {
@@ -84,15 +95,6 @@ Panel.init = function() {
this.menusEnabled_ = localStorage['useNext'] == 'true';
/**
- * A callback function to be executed to perform the action from selecting
- * a menu item after the menu has been closed and focus has been restored
- * to the page or wherever it was previously.
- * @type {?Function}
- * @private
- */
- this.pendingCallback_ = null;
-
- /**
* True if we're currently in incremental search mode.
* @type {boolean}
* @private
@@ -105,6 +107,7 @@ Panel.init = function() {
*/
this.tutorial_ = new Tutorial();
+ Panel.setPendingCallback(null);
Panel.updateFromPrefs();
Msgs.addTranslatedMessagesToDom(document);
@@ -137,8 +140,6 @@ Panel.init = function() {
Panel.closeMenusAndRestoreFocus();
}, false);
-
- Panel.searchInput_.addEventListener('blur', Panel.onSearchInputBlur, false);
};
/**
@@ -432,7 +433,7 @@ Panel.onSearch = function() {
Panel.updateFromPrefs();
Panel.setMode(Panel.Mode.FOCUSED);
- ISearchUI.get(Panel.searchInput_);
+ ISearchUI.init(Panel.searchInput_);
};
/**
@@ -753,20 +754,6 @@ Panel.onKeyDown = function(event) {
};
/**
- * Called when focus leaves the search input.
- */
-Panel.onSearchInputBlur = function() {
- if (Panel.searching_) {
- if (document.activeElement != Panel.searchInput_ || !document.hasFocus()) {
- Panel.searching_ = false;
- Panel.setMode(Panel.Mode.COLLAPSED);
- Panel.updateFromPrefs();
- Panel.searchInput_.value = '';
- }
- }
-};
-
-/**
* Open the ChromeVox Options.
*/
Panel.onOptions = function() {

Powered by Google App Engine
This is Rietveld 408576698