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

Unified Diff: chrome/browser/ui/android/infobars/confirm_infobar.cc

Issue 889613003: Add support for passing bitmaps to Android infobars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 11 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/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/confirm_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/confirm_infobar.cc b/chrome/browser/ui/android/infobars/confirm_infobar.cc
index 8c7b3bc8747e0c441d36be9e01131edb804c389f..149e0de1dc687713613283a2b2be65c55bfbe765 100644
--- a/chrome/browser/ui/android/infobars/confirm_infobar.cc
+++ b/chrome/browser/ui/android/infobars/confirm_infobar.cc
@@ -11,6 +11,8 @@
#include "chrome/browser/infobars/infobar_service.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "jni/ConfirmInfoBarDelegate_jni.h"
+#include "ui/gfx/android/java_bitmap.h"
+#include "ui/gfx/image/image.h"
// InfoBarService -------------------------------------------------------------
@@ -46,10 +48,15 @@ base::android::ScopedJavaLocalRef<jobject> ConfirmInfoBar::CreateRenderInfoBar(
base::android::ConvertUTF16ToJavaString(
env, delegate->GetLinkText());
+ ScopedJavaLocalRef<jobject> java_bitmap;
+ if (!delegate->GetIcon().IsEmpty()) {
+ java_bitmap = gfx::ConvertToJavaBitmap(delegate->GetIcon().ToSkBitmap());
+ }
+
return Java_ConfirmInfoBarDelegate_showConfirmInfoBar(
env, java_confirm_delegate_.obj(), reinterpret_cast<intptr_t>(this),
- GetEnumeratedIconId(), message_text.obj(), link_text.obj(),
- ok_button_text.obj(), cancel_button_text.obj());
+ GetEnumeratedIconId(), java_bitmap.obj(), message_text.obj(),
+ link_text.obj(), ok_button_text.obj(), cancel_button_text.obj());
}
void ConfirmInfoBar::OnLinkClicked(JNIEnv* env, jobject obj) {
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698