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

Side by Side Diff: chrome/browser/ui/passwords/password_manager_presenter.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/passwords/password_manager_presenter.h" 5 #include "chrome/browser/ui/passwords/password_manager_presenter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 base::UTF16ToUTF8(password_list_[index]->username_value), 241 base::UTF16ToUTF8(password_list_[index]->username_value),
242 password_list_[index]->password_value); 242 password_list_[index]->password_value);
243 #endif 243 #endif
244 } 244 }
245 245
246 std::vector<std::unique_ptr<autofill::PasswordForm>> 246 std::vector<std::unique_ptr<autofill::PasswordForm>>
247 PasswordManagerPresenter::GetAllPasswords() { 247 PasswordManagerPresenter::GetAllPasswords() {
248 std::vector<std::unique_ptr<autofill::PasswordForm>> ret_val; 248 std::vector<std::unique_ptr<autofill::PasswordForm>> ret_val;
249 249
250 for (const auto& form : password_list_) { 250 for (const auto& form : password_list_) {
251 ret_val.push_back(base::WrapUnique(new autofill::PasswordForm(*form))); 251 ret_val.push_back(base::MakeUnique<autofill::PasswordForm>(*form));
252 } 252 }
253 253
254 return ret_val; 254 return ret_val;
255 } 255 }
256 256
257 const autofill::PasswordForm* PasswordManagerPresenter::GetPassword( 257 const autofill::PasswordForm* PasswordManagerPresenter::GetPassword(
258 size_t index) { 258 size_t index) {
259 if (index >= password_list_.size()) { 259 if (index >= password_list_.size()) {
260 // |index| out of bounds might come from a compromised renderer 260 // |index| out of bounds might come from a compromised renderer
261 // (http://crbug.com/362054), or the user requested to get a password while 261 // (http://crbug.com/362054), or the user requested to get a password while
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 void PasswordManagerPresenter::PasswordExceptionListPopulater:: 386 void PasswordManagerPresenter::PasswordExceptionListPopulater::
387 OnGetPasswordStoreResults( 387 OnGetPasswordStoreResults(
388 std::vector<std::unique_ptr<autofill::PasswordForm>> results) { 388 std::vector<std::unique_ptr<autofill::PasswordForm>> results) {
389 page_->password_exception_list_ = std::move(results); 389 page_->password_exception_list_ = std::move(results);
390 page_->SortEntriesAndHideDuplicates(&page_->password_exception_list_, 390 page_->SortEntriesAndHideDuplicates(&page_->password_exception_list_,
391 &page_->password_exception_duplicates_, 391 &page_->password_exception_duplicates_,
392 PasswordEntryType::BLACKLISTED); 392 PasswordEntryType::BLACKLISTED);
393 page_->SetPasswordExceptionList(); 393 page_->SetPasswordExceptionList();
394 } 394 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698