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

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

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/infobars/save_password_infobar.cc ('k') | chrome/browser/ui/android/infobars/translate_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698