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

Unified Diff: chrome/browser/resources/file_manager/js/file_manager.js

Issue 10836100: Fixing race condition on banner showing code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/file_manager/js/file_manager.js
diff --git a/chrome/browser/resources/file_manager/js/file_manager.js b/chrome/browser/resources/file_manager/js/file_manager.js
index e05580d061f12540dba7bf0f098af53e51b1f8e9..c575cbe7b8a09024512266398a23eebb748db74b 100644
--- a/chrome/browser/resources/file_manager/js/file_manager.js
+++ b/chrome/browser/resources/file_manager/js/file_manager.js
@@ -3891,16 +3891,6 @@ FileManager.prototype = {
var self = this;
function showBanner(type, messageId) {
- if (!self.dialogContainer_.hasAttribute('gdrive-welcome-style')) {
- self.dialogContainer_.setAttribute('gdrive-welcome-style', true);
- var style = self.document_.createElement('link');
- style.rel = 'stylesheet';
- style.href = 'css/gdrive_welcome.css';
- self.document_.head.appendChild(style);
- style.onload = function() { showBanner(type, messageId) };
- return;
- }
-
self.showGDataWelcome_(type);
var container = self.dialogDom_.querySelector('.gdrive-welcome.' + type);
@@ -3963,6 +3953,16 @@ FileManager.prototype = {
return;
}
+ if (!self.dialogContainer_.hasAttribute('gdrive-welcome-style')) {
+ self.dialogContainer_.setAttribute('gdrive-welcome-style', true);
+ var style = self.document_.createElement('link');
+ style.rel = 'stylesheet';
+ style.href = 'css/gdrive_welcome.css';
+ self.document_.head.appendChild(style);
+ style.onload = function() { maybeShowBanner() };
+ return;
+ }
+
var counter = getHeaderCounter();
if (self.directoryModel_.getFileList().length == 0 && counter == 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698