Commit fa39c6d8 authored by serya@chromium.org's avatar serya@chromium.org

Fixing race condition on banner showing code.

Most likely it causes the bug bacause it the only code path I found that show the banner relying on potentially outdated current directory check.

BUG=140119
TEST=


Review URL: https://chromiumcodereview.appspot.com/10836100

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150298 0039d316-1c4b-4281-b951-d872f2087c98
parent 48c32e4e
......@@ -4015,16 +4015,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);
......@@ -4087,6 +4077,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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment