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

Unified Diff: chrome/browser/ui/android/website_settings_popup_android.cc

Issue 14772036: Let Android port access properly sized images (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 7 years, 7 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 | « chrome/browser/android/resource_mapper.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/website_settings_popup_android.cc
diff --git a/chrome/browser/ui/android/website_settings_popup_android.cc b/chrome/browser/ui/android/website_settings_popup_android.cc
index 1393c3950fd407053421e90e187eb98b323260dc..4ae86b3ce1a4516cf6890c994028a65d51de7160 100644
--- a/chrome/browser/ui/android/website_settings_popup_android.cc
+++ b/chrome/browser/ui/android/website_settings_popup_android.cc
@@ -7,6 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
+#include "chrome/browser/android/resource_mapper.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/website_settings/website_settings.h"
@@ -20,7 +21,6 @@
#include "jni/WebsiteSettingsPopup_jni.h"
#include "net/cert/x509_certificate.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/android/java_bitmap.h"
using base::android::CheckException;
using base::android::ConvertUTF8ToJavaString;
@@ -29,7 +29,6 @@ using base::android::GetClass;
using base::android::ScopedJavaLocalRef;
using content::CertStore;
using content::WebContents;
-using gfx::ConvertToJavaBitmap;
static jobjectArray GetCertificateChain(JNIEnv* env,
jobject obj,
@@ -106,11 +105,8 @@ void WebsiteSettingsPopupAndroid::SetIdentityInfo(
JNIEnv* env = base::android::AttachCurrentThread();
{
- const gfx::Image& icon_image = WebsiteSettingsUI::GetIdentityIcon(
- identity_info.identity_status);
- // Creates a java version of the bitmap and makes a copy of the pixels
- ScopedJavaLocalRef<jobject> icon = ConvertToJavaBitmap(
- icon_image.ToSkBitmap());
+ int icon_id = ResourceMapper::MapFromChromiumId(
+ WebsiteSettingsUI::GetIdentityIconID(identity_info.identity_status));
// The headline and the certificate dialog link of the site's identity
// section is only displayed if the site's identity was verified. If the
@@ -124,7 +120,7 @@ void WebsiteSettingsPopupAndroid::SetIdentityInfo(
ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
env, identity_info.identity_status_description);
- Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon.obj(),
+ Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon_id,
ConvertUTF8ToJavaString(env, headline).obj(), description.obj());
string16 certificate_label =
@@ -138,17 +134,16 @@ void WebsiteSettingsPopupAndroid::SetIdentityInfo(
}
{
- const gfx::Image& icon_image = WebsiteSettingsUI::GetConnectionIcon(
- identity_info.connection_status);
- ScopedJavaLocalRef<jobject> icon = ConvertToJavaBitmap(
- icon_image.ToSkBitmap());
+ int icon_id = ResourceMapper::MapFromChromiumId(
+ WebsiteSettingsUI::GetConnectionIconID(
+ identity_info.connection_status));
- ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
- env, identity_info.connection_status_description);
- Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon.obj(),
- NULL, description.obj());
+ ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
+ env, identity_info.connection_status_description);
+ Java_WebsiteSettingsPopup_addSection(env, popup_jobject_.obj(), icon_id,
+ NULL, description.obj());
- Java_WebsiteSettingsPopup_addDivider(env, popup_jobject_.obj());
+ Java_WebsiteSettingsPopup_addDivider(env, popup_jobject_.obj());
}
Java_WebsiteSettingsPopup_addMoreInfoLink(env, popup_jobject_.obj(),
« no previous file with comments | « chrome/browser/android/resource_mapper.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698