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

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

Issue 16254003: WIP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 registrar_.Add(this, 156 registrar_.Add(this,
157 chrome::NOTIFICATION_AUTH_SUPPLIED, 157 chrome::NOTIFICATION_AUTH_SUPPLIED,
158 content::NotificationService::AllSources()); 158 content::NotificationService::AllSources());
159 registrar_.Add(this, 159 registrar_.Add(this,
160 chrome::NOTIFICATION_SESSION_STARTED, 160 chrome::NOTIFICATION_SESSION_STARTED,
161 content::NotificationService::AllSources()); 161 content::NotificationService::AllSources());
162 cros_settings_->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, this); 162 cros_settings_->AddSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, this);
163 cros_settings_->AddSettingsObserver(kAccountsPrefAllowNewUser, this); 163 cros_settings_->AddSettingsObserver(kAccountsPrefAllowNewUser, this);
164 cros_settings_->AddSettingsObserver(kAccountsPrefAllowGuest, this); 164 cros_settings_->AddSettingsObserver(kAccountsPrefAllowGuest, this);
165 cros_settings_->AddSettingsObserver(kAccountsPrefUsers, this); 165 cros_settings_->AddSettingsObserver(kAccountsPrefUsers, this);
166 g_browser_process->device_policy_change_watcher()->AddObserver(this);
166 } 167 }
167 168
168 void ExistingUserController::Init(const UserList& users) { 169 void ExistingUserController::Init(const UserList& users) {
169 time_init_ = base::Time::Now(); 170 time_init_ = base::Time::Now();
170 UpdateLoginDisplay(users); 171 UpdateLoginDisplay(users);
171 172
172 LoginUtils::Get()->PrewarmAuthentication(); 173 LoginUtils::Get()->PrewarmAuthentication();
173 DBusThreadManager::Get()->GetSessionManagerClient()->EmitLoginPromptReady(); 174 DBusThreadManager::Get()->GetSessionManagerClient()->EmitLoginPromptReady();
174 } 175 }
175 176
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 base::Bind(&TransferContextAuthenticationsOnIOThread, 260 base::Bind(&TransferContextAuthenticationsOnIOThread,
260 default_profile_context_getter, 261 default_profile_context_getter,
261 browser_process_context_getter), 262 browser_process_context_getter),
262 base::TimeDelta::FromMilliseconds(kAuthCacheTransferDelayMs)); 263 base::TimeDelta::FromMilliseconds(kAuthCacheTransferDelayMs));
263 } 264 }
264 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) 265 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED)
265 return; 266 return;
266 login_display_->OnUserImageChanged(*content::Details<User>(details).ptr()); 267 login_display_->OnUserImageChanged(*content::Details<User>(details).ptr());
267 } 268 }
268 269
270 void ExistingUserController::OnDevicePolicyStatusChanged(
271 const std::vector<std::string>& users_with_changed_device_policy) {
272 LOG(ERROR) << "Device policy change for "
273 << users_with_changed_device_policy.size() << " users.";
274 }
275
269 //////////////////////////////////////////////////////////////////////////////// 276 ////////////////////////////////////////////////////////////////////////////////
270 // ExistingUserController, private: 277 // ExistingUserController, private:
271 278
272 ExistingUserController::~ExistingUserController() { 279 ExistingUserController::~ExistingUserController() {
273 LoginUtils::Get()->DelegateDeleted(this); 280 LoginUtils::Get()->DelegateDeleted(this);
274 281
275 cros_settings_->RemoveSettingsObserver(kAccountsPrefShowUserNamesOnSignIn, 282 cros_settings_->RemoveSettingsObserver(kAccountsPrefShowUserNamesOnSignIn,
276 this); 283 this);
277 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowNewUser, this); 284 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowNewUser, this);
278 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowGuest, this); 285 cros_settings_->RemoveSettingsObserver(kAccountsPrefAllowGuest, this);
279 cros_settings_->RemoveSettingsObserver(kAccountsPrefUsers, this); 286 cros_settings_->RemoveSettingsObserver(kAccountsPrefUsers, this);
287 g_browser_process->device_policy_change_watcher()->RemoveObserver(this);
280 288
281 if (current_controller_ == this) { 289 if (current_controller_ == this) {
282 current_controller_ = NULL; 290 current_controller_ = NULL;
283 } else { 291 } else {
284 NOTREACHED() << "More than one controller are alive."; 292 NOTREACHED() << "More than one controller are alive.";
285 } 293 }
286 DCHECK(login_display_.get()); 294 DCHECK(login_display_.get());
287 } 295 }
288 296
289 //////////////////////////////////////////////////////////////////////////////// 297 ////////////////////////////////////////////////////////////////////////////////
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 // changed. 1006 // changed.
999 UserManager::Get()->SaveUserOAuthStatus( 1007 UserManager::Get()->SaveUserOAuthStatus(
1000 username, 1008 username,
1001 User::OAUTH2_TOKEN_STATUS_INVALID); 1009 User::OAUTH2_TOKEN_STATUS_INVALID);
1002 1010
1003 login_display_->SetUIEnabled(true); 1011 login_display_->SetUIEnabled(true);
1004 login_display_->ShowGaiaPasswordChanged(username); 1012 login_display_->ShowGaiaPasswordChanged(username);
1005 } 1013 }
1006 1014
1007 } // namespace chromeos 1015 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698