Commit 5166f530 authored by Nancy Wang's avatar Nancy Wang Committed by Commit Bot

Fix the Google Hangouts extension icon loading issue.

When switch users, the 'FetchImage' function is called. However, if the
icon image has been loaded, the 'ChromeAppIconLoader::FetchImage'
function returns directly, and doesn't reset the icon for the delegate.
This might cause the blank icon issue for some extensions, e.g. the
Google Hangouts extension.

This CL modifies the function 'ChromeAppIconLoader::FetchImage'. If the
icon image has been loaded, call OnIconUpdated to set the icon for the
delegate.

BUG=1142226

Change-Id: I5d698844d72fbb71925d281cc11bc419e19f691e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494409Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#821587}
parent b6e1e1f2
...@@ -53,8 +53,12 @@ bool ChromeAppIconLoader::CanLoadImageForApp(const std::string& id) { ...@@ -53,8 +53,12 @@ bool ChromeAppIconLoader::CanLoadImageForApp(const std::string& id) {
} }
void ChromeAppIconLoader::FetchImage(const std::string& id) { void ChromeAppIconLoader::FetchImage(const std::string& id) {
if (map_.find(id) != map_.end()) auto it = map_.find(id);
return; // Already loading the image. if (it != map_.end()) {
if (it->second && !it->second->image_skia().isNull())
OnIconUpdated(it->second.get());
return; // Already loaded the image.
}
const Extension* extension = GetExtensionByID(profile(), id); const Extension* extension = GetExtensionByID(profile(), id);
if (!extension) if (!extension)
......
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