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

Side by Side Diff: chrome/browser/chromeos/login/user_manager.cc

Issue 8651005: Cleanup: Remove an unused variable. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/defaults.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/user_manager.h" 5 #include "chrome/browser/chromeos/login/user_manager.h"
6 6
7 #include <vector>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/command_line.h" 10 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 12 #include "base/file_path.h"
11 #include "base/file_util.h" 13 #include "base/file_util.h"
12 #include "base/lazy_instance.h" 14 #include "base/lazy_instance.h"
13 #include "base/location.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
17 #include "base/path_service.h" 18 #include "base/path_service.h"
18 #include "base/rand_util.h" 19 #include "base/rand_util.h"
19 #include "base/string_util.h" 20 #include "base/string_util.h"
20 #include "base/stringprintf.h" 21 #include "base/stringprintf.h"
21 #include "base/task.h" 22 #include "base/task.h"
22 #include "base/time.h" 23 #include "base/time.h"
23 #include "base/utf_string_conversions.h" 24 #include "base/utf_string_conversions.h"
24 #include "base/values.h" 25 #include "base/values.h"
25 #include "chrome/browser/browser_process.h" 26 #include "chrome/browser/browser_process.h"
26 #include "chrome/browser/chromeos/cros/cert_library.h" 27 #include "chrome/browser/chromeos/cros/cert_library.h"
27 #include "chrome/browser/chromeos/cros/cros_library.h" 28 #include "chrome/browser/chromeos/cros/cros_library.h"
28 #include "chrome/browser/chromeos/cros/cryptohome_library.h" 29 #include "chrome/browser/chromeos/cros/cryptohome_library.h"
29 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 30 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
30 #include "chrome/browser/chromeos/login/default_user_images.h" 31 #include "chrome/browser/chromeos/login/default_user_images.h"
31 #include "chrome/browser/chromeos/login/helper.h" 32 #include "chrome/browser/chromeos/login/helper.h"
32 #include "chrome/browser/chromeos/login/login_display.h" 33 #include "chrome/browser/chromeos/login/login_display.h"
33 #include "chrome/browser/chromeos/login/ownership_service.h" 34 #include "chrome/browser/chromeos/login/ownership_service.h"
34 #include "chrome/browser/chromeos/system/runtime_environment.h" 35 #include "chrome/browser/chromeos/system/runtime_environment.h"
35 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 36 #include "chrome/browser/chromeos/user_cros_settings_provider.h"
36 #include "chrome/browser/defaults.h"
37 #include "chrome/browser/prefs/pref_service.h" 37 #include "chrome/browser/prefs/pref_service.h"
38 #include "chrome/browser/prefs/scoped_user_pref_update.h" 38 #include "chrome/browser/prefs/scoped_user_pref_update.h"
39 #include "chrome/browser/ui/webui/web_ui_util.h" 39 #include "chrome/browser/ui/webui/web_ui_util.h"
40 #include "chrome/common/chrome_notification_types.h" 40 #include "chrome/common/chrome_notification_types.h"
41 #include "chrome/common/chrome_paths.h" 41 #include "chrome/common/chrome_paths.h"
42 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
43 #include "content/public/browser/browser_thread.h" 43 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
45 #include "content/public/common/url_constants.h" 45 #include "content/public/common/url_constants.h"
46 #include "crypto/nss_util.h" 46 #include "crypto/nss_util.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // Skip the most recent user. 232 // Skip the most recent user.
233 if (email != user_email) 233 if (email != user_email)
234 prefs_users_update->Append(Value::CreateStringValue(user_email)); 234 prefs_users_update->Append(Value::CreateStringValue(user_email));
235 else 235 else
236 logged_in_user = it; 236 logged_in_user = it;
237 } 237 }
238 prefs->ScheduleSavePersistentPrefs(); 238 prefs->ScheduleSavePersistentPrefs();
239 239
240 if (logged_in_user == users_.end()) { 240 if (logged_in_user == users_.end()) {
241 current_user_is_new_ = true; 241 current_user_is_new_ = true;
242 browser_defaults::skip_restore = true;
243 logged_in_user_ = CreateUser(email); 242 logged_in_user_ = CreateUser(email);
244 } else { 243 } else {
245 logged_in_user_ = *logged_in_user; 244 logged_in_user_ = *logged_in_user;
246 users_.erase(logged_in_user); 245 users_.erase(logged_in_user);
247 } 246 }
248 // This user must be in the front of the user list. 247 // This user must be in the front of the user list.
249 users_.insert(users_.begin(), logged_in_user_); 248 users_.insert(users_.begin(), logged_in_user_);
250 249
251 NotifyOnLogin(); 250 NotifyOnLogin();
252 251
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 852
854 User* UserManager::CreateUser(const std::string& email) const { 853 User* UserManager::CreateUser(const std::string& email) const {
855 User* user = new User(email); 854 User* user = new User(email);
856 user->set_oauth_token_status(GetUserOAuthStatus(email)); 855 user->set_oauth_token_status(GetUserOAuthStatus(email));
857 // Used to determine whether user's display name is unique. 856 // Used to determine whether user's display name is unique.
858 ++display_name_count_[user->GetDisplayName()]; 857 ++display_name_count_[user->GetDisplayName()];
859 return user; 858 return user;
860 } 859 }
861 860
862 } // namespace chromeos 861 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/defaults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698