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