| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 | 26 |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Adds specified user to the whitelist. Returns false if that user is already | 31 // Adds specified user to the whitelist. Returns false if that user is already |
| 32 // in the whitelist. | 32 // in the whitelist. |
| 33 bool WhitelistUser(const std::string& username) { | 33 bool WhitelistUser(const std::string& username) { |
| 34 CrosSettings* cros_settings = CrosSettings::Get(); | 34 CrosSettings* cros_settings = CrosSettings::Get(); |
| 35 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username)) | 35 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username, NULL)) |
| 36 return false; | 36 return false; |
| 37 base::StringValue username_value(username); | 37 base::StringValue username_value(username); |
| 38 cros_settings->AppendToList(kAccountsPrefUsers, &username_value); | 38 cros_settings->AppendToList(kAccountsPrefUsers, &username_value); |
| 39 return true; | 39 return true; |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 namespace options { | 44 namespace options { |
| 45 | 45 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 const UserList& users = UserManager::Get()->GetUsers(); | 133 const UserList& users = UserManager::Get()->GetUsers(); |
| 134 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) | 134 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) |
| 135 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | 135 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); |
| 136 | 136 |
| 137 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); | 137 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace options | 140 } // namespace options |
| 141 } // namespace chromeos | 141 } // namespace chromeos |
| OLD | NEW |