Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
| 15 #include "base/memory/ptr_util.h" | |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 19 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
| 19 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 20 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 20 #include "chrome/browser/chromeos/settings/cros_settings.h" | 21 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/profiles/profile_metrics.h" | 23 #include "chrome/browser/profiles/profile_metrics.h" |
| 23 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 24 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 24 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 new_list->GetString(i, &whitelisted_user); | 160 new_list->GetString(i, &whitelisted_user); |
| 160 if (gaia::ExtractDomainName(whitelisted_user) == | 161 if (gaia::ExtractDomainName(whitelisted_user) == |
| 161 chromeos::login::kSupervisedUserDomain) { | 162 chromeos::login::kSupervisedUserDomain) { |
| 162 new_list->Remove(i, NULL); | 163 new_list->Remove(i, NULL); |
| 163 --i; | 164 --i; |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 | 167 |
| 167 const user_manager::UserList& users = | 168 const user_manager::UserList& users = |
| 168 user_manager::UserManager::Get()->GetUsers(); | 169 user_manager::UserManager::Get()->GetUsers(); |
| 169 for (user_manager::UserList::const_iterator it = users.begin(); | 170 for (const auto& user : users) |
|
danakj
2016/09/14 01:55:59
{}
also this is a pointer so const auto*?
dcheng
2016/09/14 03:06:11
Done, I assumed it a std::unique_ptr but I guess I
| |
| 170 it < users.end(); | 171 new_list->AppendIfNotPresent( |
| 171 ++it) | 172 base::MakeUnique<base::StringValue>(user->email())); |
| 172 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | |
| 173 | 173 |
| 174 if (OwnerSettingsServiceChromeOS* service = | 174 if (OwnerSettingsServiceChromeOS* service = |
| 175 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { | 175 OwnerSettingsServiceChromeOS::FromWebUI(web_ui())) { |
| 176 service->Set(kAccountsPrefUsers, *new_list.get()); | 176 service->Set(kAccountsPrefUsers, *new_list.get()); |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace options | 180 } // namespace options |
| 181 } // namespace chromeos | 181 } // namespace chromeos |
| OLD | NEW |