Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / file_manager / foreground / js / ui / file_manager_ui.js
index fba0402..a1e085d 100644 (file)
@@ -101,7 +101,7 @@ var FileManagerUI = function(element, dialogType) {
   Object.seal(this);
 
   // Initialize the header.
-  this.updateProfileBatch();
+  this.updateProfileBadge();
   this.element_.querySelector('#app-name').innerText =
       chrome.runtime.getManifest().name;
 
@@ -191,9 +191,9 @@ FileManagerUI.prototype.initAdditionalUI = function() {
 };
 
 /**
- * Updates visibility and image of the profile batch.
+ * Updates visibility and image of the profile badge.
  */
-FileManagerUI.prototype.updateProfileBatch = function() {
+FileManagerUI.prototype.updateProfileBadge = function() {
   if (this.dialogType_ !== DialogType.FULL_PAGE)
     return;
 
@@ -203,16 +203,16 @@ FileManagerUI.prototype.updateProfileBatch = function() {
     var imageUri;
     if (currentId !== displayedId) {
       for (var i = 0; i < profiles.length; i++) {
-        if (profiles[i].profileId !== currentId) {
+        if (profiles[i].profileId === currentId) {
           imageUri = profiles[i].imageUri;
           break;
         }
       }
     }
-    var profileBatch = this.element_.querySelector('#profile-batch');
+    var profileBadge = this.element_.querySelector('#profile-badge');
     if (imageUri)
-      profileBatch.setAttribute('src', imageUri);
+      profileBadge.setAttribute('src', imageUri);
     else
-      profileBatch.removeAttribute('src');
+      profileBadge.removeAttribute('src');
   }.bind(this));
 };