| OLD | NEW |
| 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 <utility> |
| 8 |
| 7 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| 9 #include "jni/SavePasswordInfoBar_jni.h" | 11 #include "jni/SavePasswordInfoBar_jni.h" |
| 10 | 12 |
| 11 SavePasswordInfoBar::SavePasswordInfoBar( | 13 SavePasswordInfoBar::SavePasswordInfoBar( |
| 12 scoped_ptr<SavePasswordInfoBarDelegate> delegate) | 14 scoped_ptr<SavePasswordInfoBarDelegate> delegate) |
| 13 : ConfirmInfoBar(delegate.Pass()) { | 15 : ConfirmInfoBar(std::move(delegate)) {} |
| 14 } | |
| 15 | 16 |
| 16 SavePasswordInfoBar::~SavePasswordInfoBar() { | 17 SavePasswordInfoBar::~SavePasswordInfoBar() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 base::android::ScopedJavaLocalRef<jobject> | 20 base::android::ScopedJavaLocalRef<jobject> |
| 20 SavePasswordInfoBar::CreateRenderInfoBar(JNIEnv* env) { | 21 SavePasswordInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
| 21 using base::android::ConvertUTF16ToJavaString; | 22 using base::android::ConvertUTF16ToJavaString; |
| 22 using base::android::ScopedJavaLocalRef; | 23 using base::android::ScopedJavaLocalRef; |
| 23 SavePasswordInfoBarDelegate* save_password_delegate = | 24 SavePasswordInfoBarDelegate* save_password_delegate = |
| 24 static_cast<SavePasswordInfoBarDelegate*>(delegate()); | 25 static_cast<SavePasswordInfoBarDelegate*>(delegate()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 43 const JavaParamRef<jobject>& obj) { | 44 const JavaParamRef<jobject>& obj) { |
| 44 GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB); | 45 GetDelegate()->LinkClicked(NEW_FOREGROUND_TAB); |
| 45 } | 46 } |
| 46 | 47 |
| 47 bool SavePasswordInfoBar::Register(JNIEnv* env) { | 48 bool SavePasswordInfoBar::Register(JNIEnv* env) { |
| 48 return RegisterNativesImpl(env); | 49 return RegisterNativesImpl(env); |
| 49 } | 50 } |
| 50 | 51 |
| 51 scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar( | 52 scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar( |
| 52 scoped_ptr<SavePasswordInfoBarDelegate> delegate) { | 53 scoped_ptr<SavePasswordInfoBarDelegate> delegate) { |
| 53 return make_scoped_ptr(new SavePasswordInfoBar(delegate.Pass())); | 54 return make_scoped_ptr(new SavePasswordInfoBar(std::move(delegate))); |
| 54 } | 55 } |
| OLD | NEW |