| 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/options2/chromeos/accounts_options_handler.h" | 5 #include "chrome/browser/ui/webui/options2/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 23 matching lines...) Expand all Loading... |
| 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)) |
| 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 options2 { | 44 namespace options { |
| 45 | 45 |
| 46 AccountsOptionsHandler::AccountsOptionsHandler() { | 46 AccountsOptionsHandler::AccountsOptionsHandler() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 AccountsOptionsHandler::~AccountsOptionsHandler() { | 49 AccountsOptionsHandler::~AccountsOptionsHandler() { |
| 50 } | 50 } |
| 51 | 51 |
| 52 void AccountsOptionsHandler::RegisterMessages() { | 52 void AccountsOptionsHandler::RegisterMessages() { |
| 53 web_ui()->RegisterMessageCallback("whitelistUser", | 53 web_ui()->RegisterMessageCallback("whitelistUser", |
| 54 base::Bind(&AccountsOptionsHandler::HandleWhitelistUser, | 54 base::Bind(&AccountsOptionsHandler::HandleWhitelistUser, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 else | 128 else |
| 129 new_list.reset(new base::ListValue); | 129 new_list.reset(new base::ListValue); |
| 130 | 130 |
| 131 const UserList& users = UserManager::Get()->GetUsers(); | 131 const UserList& users = UserManager::Get()->GetUsers(); |
| 132 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) | 132 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) |
| 133 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); | 133 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); |
| 134 | 134 |
| 135 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); | 135 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace options2 | 138 } // namespace options |
| 139 } // namespace chromeos | 139 } // namespace chromeos |
| OLD | NEW |