Commit 6c48ea86 authored by aruslan@chromium.org's avatar aruslan@chromium.org

[Mirror Android] Do not return "old style" avatar icons.

BUG=360732
NOTRY=True

Review URL: https://codereview.chromium.org/232743004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263088 0039d316-1c4b-4281-b951-d872f2087c98
parent c1367ba1
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/android/jni_string.h" #include "base/android/jni_string.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_android.h" #include "chrome/browser/profiles/profile_android.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_downloader.h" #include "chrome/browser/profiles/profile_downloader.h"
#include "chrome/browser/profiles/profile_downloader_delegate.h" #include "chrome/browser/profiles/profile_downloader_delegate.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
...@@ -135,9 +136,13 @@ jobject GetCachedAvatarForPrimaryAccount(JNIEnv* env, ...@@ -135,9 +136,13 @@ jobject GetCachedAvatarForPrimaryAccount(JNIEnv* env,
ScopedJavaLocalRef<jobject> jbitmap; ScopedJavaLocalRef<jobject> jbitmap;
if (index != std::string::npos) { if (index != std::string::npos) {
const gfx::Image& img = info.GetAvatarIconOfProfileAtIndex(index); gfx::Image avatar_image = info.GetAvatarIconOfProfileAtIndex(index);
if (!img.IsEmpty() && img.AsImageSkia().bitmap()) if (!avatar_image.IsEmpty() &&
jbitmap = gfx::ConvertToJavaBitmap(img.AsImageSkia().bitmap()); avatar_image.Width() > profiles::kAvatarIconWidth &&
avatar_image.Height() > profiles::kAvatarIconHeight &&
avatar_image.AsImageSkia().bitmap()) {
jbitmap = gfx::ConvertToJavaBitmap(avatar_image.AsImageSkia().bitmap());
}
} }
return jbitmap.Release(); return jbitmap.Release();
......
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