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

Unified Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc

Issue 2336863003: Change more base::ListValue methods to use std::unique_ptr. (Closed)
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
index 167ef934b4e3c984771751dab317707aa54bdf43..523700c058571f50540a279e2c9f17ad85ba314c 100644
--- a/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/accounts_options_handler.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/json/json_reader.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@@ -166,10 +167,10 @@ void AccountsOptionsHandler::HandleUpdateWhitelist(
const user_manager::UserList& users =
user_manager::UserManager::Get()->GetUsers();
- for (user_manager::UserList::const_iterator it = users.begin();
- it < users.end();
- ++it)
- new_list->AppendIfNotPresent(new base::StringValue((*it)->email()));
+ for (const auto* user : users) {
+ new_list->AppendIfNotPresent(
+ base::MakeUnique<base::StringValue>(user->email()));
+ }
if (OwnerSettingsServiceChromeOS* service =
OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) {

Powered by Google App Engine
This is Rietveld 408576698