| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/simple_confirm_infobar_builder.h" | 5 #include "chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 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" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 base::string16 primary_str = j_primary.is_null() | 154 base::string16 primary_str = j_primary.is_null() |
| 155 ? base::string16() | 155 ? base::string16() |
| 156 : base::android::ConvertJavaStringToUTF16(env, j_primary); | 156 : base::android::ConvertJavaStringToUTF16(env, j_primary); |
| 157 base::string16 secondary_str = j_secondary.is_null() | 157 base::string16 secondary_str = j_secondary.is_null() |
| 158 ? base::string16() | 158 ? base::string16() |
| 159 : base::android::ConvertJavaStringToUTF16(env, j_secondary); | 159 : base::android::ConvertJavaStringToUTF16(env, j_secondary); |
| 160 | 160 |
| 161 InfoBarService* service = InfoBarService::FromWebContents( | 161 InfoBarService* service = InfoBarService::FromWebContents( |
| 162 TabAndroid::GetNativeTab(env, j_tab)->web_contents()); | 162 TabAndroid::GetNativeTab(env, j_tab)->web_contents()); |
| 163 service->AddInfoBar(service->CreateConfirmInfoBar( | 163 service->AddInfoBar(service->CreateConfirmInfoBar( |
| 164 base::WrapUnique(new SimpleConfirmInfoBarDelegate( | 164 base::MakeUnique<SimpleConfirmInfoBarDelegate>( |
| 165 j_listener, infobar_identifier, icon_bitmap, message_str, primary_str, | 165 j_listener, infobar_identifier, icon_bitmap, message_str, primary_str, |
| 166 secondary_str, auto_expire)))); | 166 secondary_str, auto_expire))); |
| 167 } | 167 } |
| 168 | 168 |
| 169 bool RegisterSimpleConfirmInfoBarBuilder(JNIEnv* env) { | 169 bool RegisterSimpleConfirmInfoBarBuilder(JNIEnv* env) { |
| 170 return RegisterNativesImpl(env); | 170 return RegisterNativesImpl(env); |
| 171 } | 171 } |
| OLD | NEW |