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

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js

Issue 1105333003: Fix potential flakiness in Files.app test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
index f19d985568ab8c2753a6ec0fb0010b4522b1e79d..232e62cac61b3fa86b1bc498eebf4ee2d89cd62e 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
@@ -314,23 +314,24 @@ FileManagerUI.prototype.initAdditionalUI = function(
// Add handlers.
document.defaultView.addEventListener('resize', this.relayout.bind(this));
+};
+/**
+ * Initializes the focus.
+ */
+FileManagerUI.prototype.initUIFocus = function() {
// Set the initial focus. When there is no focus, the active element is the
// <body>.
- setTimeout(function() {
- if (document.activeElement === document.body) {
- var targetElement = null;
- if (this.dialogType_ == DialogType.SELECT_SAVEAS_FILE) {
- targetElement = this.dialogFooter.filenameInput;
- } else if (this.listContainer.currentListType !=
- ListContainer.ListType.UNINITIALIZED) {
- targetElement = this.listContainer.currentList;
- }
-
- if (targetElement)
- targetElement.focus();
- }
- }.bind(this), 0);
+ var targetElement = null;
+ if (this.dialogType_ == DialogType.SELECT_SAVEAS_FILE) {
+ targetElement = this.dialogFooter.filenameInput;
+ } else if (this.listContainer.currentListType !=
+ ListContainer.ListType.UNINITIALIZED) {
+ targetElement = this.listContainer.currentList;
+ }
+
+ if (targetElement)
+ targetElement.focus();
};
/**
« no previous file with comments | « ui/file_manager/file_manager/foreground/js/ui/banners.js ('k') | ui/file_manager/integration_tests/file_manager/tab_index.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698