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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/android/infobars/save_password_infobar.h"
6
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "jni/SavePasswordInfoBar_jni.h"
10
11 SavePasswordInfoBar::SavePasswordInfoBar(
12 scoped_ptr<SavePasswordInfoBarDelegate> delegate)
13 : ConfirmInfoBar(delegate.Pass()) {
14 }
15
16 SavePasswordInfoBar::~SavePasswordInfoBar() {
17 }
18
19 base::android::ScopedJavaLocalRef<jobject>
20 SavePasswordInfoBar::CreateRenderInfoBar(JNIEnv* env) {
21 using base::android::ConvertUTF16ToJavaString;
22 using base::android::ScopedJavaLocalRef;
23 SavePasswordInfoBarDelegate* save_password_delegate =
24 static_cast<SavePasswordInfoBarDelegate*>(delegate());
25 ScopedJavaLocalRef<jstring> ok_button_text = ConvertUTF16ToJavaString(
26 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK));
27 ScopedJavaLocalRef<jstring> cancel_button_text = ConvertUTF16ToJavaString(
28 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_CANCEL));
29 ScopedJavaLocalRef<jstring> message_text = ConvertUTF16ToJavaString(
30 env, save_password_delegate->GetMessageText());
31
32 return Java_SavePasswordInfoBar_show(
33 env, reinterpret_cast<intptr_t>(this), GetEnumeratedIconId(),
34 message_text.obj(), ok_button_text.obj(), cancel_button_text.obj(),
35 save_password_delegate->ShouldShowMoreButton());
36 }
37
38 bool SavePasswordInfoBar::Register(JNIEnv* env) {
39 return RegisterNativesImpl(env);
40 }
OLDNEW
« 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