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

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

Issue 967193002: Credential saving clank infobar for Smart Lock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reusable_more_button
Patch Set: Created 5 years, 9 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/ui/android/infobars/save_password_infobar.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/infobars/save_password_infobar.cc
diff --git a/chrome/browser/ui/android/infobars/save_password_infobar.cc b/chrome/browser/ui/android/infobars/save_password_infobar.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7704e3c3ef101c075619cf488e09e05a59925776
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/save_password_infobar.cc
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/android/infobars/save_password_infobar.h"
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_string.h"
+#include "jni/SavePasswordInfoBar_jni.h"
+
+SavePasswordInfoBar::SavePasswordInfoBar(
+ scoped_ptr<SavePasswordInfoBarDelegate> delegate)
+ : ConfirmInfoBar(delegate.Pass()) {
+}
+
+SavePasswordInfoBar::~SavePasswordInfoBar() {
+}
+
+base::android::ScopedJavaLocalRef<jobject>
+SavePasswordInfoBar::CreateRenderInfoBar(JNIEnv* env) {
+ using base::android::ConvertUTF16ToJavaString;
+ using base::android::ScopedJavaLocalRef;
+ SavePasswordInfoBarDelegate* save_password_delegate =
+ static_cast<SavePasswordInfoBarDelegate*>(delegate());
+ ScopedJavaLocalRef<jstring> ok_button_text = ConvertUTF16ToJavaString(
+ env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK));
+ ScopedJavaLocalRef<jstring> cancel_button_text = ConvertUTF16ToJavaString(
+ env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_CANCEL));
+ ScopedJavaLocalRef<jstring> message_text = ConvertUTF16ToJavaString(
+ env, save_password_delegate->GetMessageText());
+
+ return Java_SavePasswordInfoBar_show(
+ env, reinterpret_cast<intptr_t>(this), GetEnumeratedIconId(),
+ message_text.obj(), ok_button_text.obj(), cancel_button_text.obj(),
+ save_password_delegate->ShouldShowMoreButton());
+}
+
+bool SavePasswordInfoBar::Register(JNIEnv* env) {
+ return RegisterNativesImpl(env);
+}
« no previous file with comments | « chrome/browser/ui/android/infobars/save_password_infobar.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698