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

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

Issue 398753004: [cros] Move User class to user_manager component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // is stale and should not be used for appending. See http://crbug.com/127215 127 // is stale and should not be used for appending. See http://crbug.com/127215
128 scoped_ptr<base::ListValue> new_list; 128 scoped_ptr<base::ListValue> new_list;
129 129
130 CrosSettings* cros_settings = CrosSettings::Get(); 130 CrosSettings* cros_settings = CrosSettings::Get();
131 const base::ListValue* existing = NULL; 131 const base::ListValue* existing = NULL;
132 if (cros_settings->GetList(kAccountsPrefUsers, &existing) && existing) 132 if (cros_settings->GetList(kAccountsPrefUsers, &existing) && existing)
133 new_list.reset(existing->DeepCopy()); 133 new_list.reset(existing->DeepCopy());
134 else 134 else
135 new_list.reset(new base::ListValue); 135 new_list.reset(new base::ListValue);
136 136
137 const UserList& users = UserManager::Get()->GetUsers(); 137 const user_manager::UserList& users = UserManager::Get()->GetUsers();
138 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) 138 for (user_manager::UserList::const_iterator it = users.begin();
139 it < users.end();
140 ++it)
139 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); 141 new_list->AppendIfNotPresent(new base::StringValue((*it)->email()));
140 142
141 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); 143 cros_settings->Set(kAccountsPrefUsers, *new_list.get());
142 } 144 }
143 145
144 } // namespace options 146 } // namespace options
145 } // namespace chromeos 147 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698