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

Side by Side Diff: chrome/browser/ui/android/infobars/save_password_infobar.cc

Issue 1150193004: Straighten up life cycle of native InfoBar pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed unrelated file Created 5 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/infobars/save_password_infobar.h" 5 #include "chrome/browser/ui/android/infobars/save_password_infobar.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "jni/SavePasswordInfoBar_jni.h" 9 #include "jni/SavePasswordInfoBar_jni.h"
10 10
(...skipping 12 matching lines...) Expand all
23 SavePasswordInfoBarDelegate* save_password_delegate = 23 SavePasswordInfoBarDelegate* save_password_delegate =
24 static_cast<SavePasswordInfoBarDelegate*>(delegate()); 24 static_cast<SavePasswordInfoBarDelegate*>(delegate());
25 ScopedJavaLocalRef<jstring> ok_button_text = ConvertUTF16ToJavaString( 25 ScopedJavaLocalRef<jstring> ok_button_text = ConvertUTF16ToJavaString(
26 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK)); 26 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_OK));
27 ScopedJavaLocalRef<jstring> cancel_button_text = ConvertUTF16ToJavaString( 27 ScopedJavaLocalRef<jstring> cancel_button_text = ConvertUTF16ToJavaString(
28 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_CANCEL)); 28 env, GetTextFor(ConfirmInfoBarDelegate::BUTTON_CANCEL));
29 ScopedJavaLocalRef<jstring> message_text = ConvertUTF16ToJavaString( 29 ScopedJavaLocalRef<jstring> message_text = ConvertUTF16ToJavaString(
30 env, save_password_delegate->GetMessageText()); 30 env, save_password_delegate->GetMessageText());
31 31
32 return Java_SavePasswordInfoBar_show( 32 return Java_SavePasswordInfoBar_show(
33 env, reinterpret_cast<intptr_t>(this), GetEnumeratedIconId(), 33 env, GetEnumeratedIconId(), message_text.obj(),
34 message_text.obj(), save_password_delegate->title_link_range().start(), 34 save_password_delegate->title_link_range().start(),
35 save_password_delegate->title_link_range().end(), ok_button_text.obj(), 35 save_password_delegate->title_link_range().end(), ok_button_text.obj(),
36 cancel_button_text.obj(), save_password_delegate->ShouldShowMoreButton()); 36 cancel_button_text.obj(), save_password_delegate->ShouldShowMoreButton());
37 } 37 }
38 38
39 void SavePasswordInfoBar::OnLinkClicked(JNIEnv* env, jobject obj) { 39 void SavePasswordInfoBar::OnLinkClicked(JNIEnv* env, jobject obj) {
40 GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB); 40 GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB);
41 } 41 }
42 42
43 bool SavePasswordInfoBar::Register(JNIEnv* env) { 43 bool SavePasswordInfoBar::Register(JNIEnv* env) {
44 return RegisterNativesImpl(env); 44 return RegisterNativesImpl(env);
45 } 45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698