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

Side by Side Diff: ios/chrome/browser/passwords/password_controller.mm

Issue 2256193002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #import "ios/chrome/browser/passwords/password_controller.h" 5 #import "ios/chrome/browser/passwords/password_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 206
207 // The normalized URL of the web page. 207 // The normalized URL of the web page.
208 rootDict.SetString("origin", formData.origin.spec()); 208 rootDict.SetString("origin", formData.origin.spec());
209 209
210 // The normalized URL from the "action" attribute of the <form> tag. 210 // The normalized URL from the "action" attribute of the <form> tag.
211 rootDict.SetString("action", formData.action.spec()); 211 rootDict.SetString("action", formData.action.spec());
212 212
213 // Input elements in the form. The list does not necessarily contain 213 // Input elements in the form. The list does not necessarily contain
214 // all elements from the form, but all elements listed here are required 214 // all elements from the form, but all elements listed here are required
215 // to identify the right form to fill. 215 // to identify the right form to fill.
216 auto fieldList = base::WrapUnique(new base::ListValue()); 216 auto fieldList = base::MakeUnique<base::ListValue>();
217 217
218 auto usernameField = base::WrapUnique(new base::DictionaryValue()); 218 auto usernameField = base::MakeUnique<base::DictionaryValue>();
219 usernameField->SetString("name", formData.username_field.name); 219 usernameField->SetString("name", formData.username_field.name);
220 usernameField->SetString("value", formData.username_field.value); 220 usernameField->SetString("value", formData.username_field.value);
221 fieldList->Append(usernameField.release()); 221 fieldList->Append(usernameField.release());
222 222
223 auto passwordField = base::WrapUnique(new base::DictionaryValue()); 223 auto passwordField = base::MakeUnique<base::DictionaryValue>();
224 passwordField->SetString("name", formData.password_field.name); 224 passwordField->SetString("name", formData.password_field.name);
225 passwordField->SetString("value", formData.password_field.value); 225 passwordField->SetString("value", formData.password_field.value);
226 fieldList->Append(passwordField.release()); 226 fieldList->Append(passwordField.release());
227 227
228 rootDict.Set("fields", fieldList.release()); 228 rootDict.Set("fields", fieldList.release());
229 229
230 std::string jsonString; 230 std::string jsonString;
231 base::JSONWriter::Write(rootDict, &jsonString); 231 base::JSONWriter::Write(rootDict, &jsonString);
232 return base::SysUTF8ToNSString(jsonString); 232 return base::SysUTF8ToNSString(jsonString);
233 } 233 }
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 break; 864 break;
865 865
866 case PasswordInfoBarType::UPDATE: 866 case PasswordInfoBarType::UPDATE:
867 IOSChromeUpdatePasswordInfoBarDelegate::Create( 867 IOSChromeUpdatePasswordInfoBarDelegate::Create(
868 isSmartLockBrandingEnabled, infoBarManager, std::move(form)); 868 isSmartLockBrandingEnabled, infoBarManager, std::move(form));
869 break; 869 break;
870 } 870 }
871 } 871 }
872 872
873 @end 873 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698