| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 Source<UserManager>(this), | 249 Source<UserManager>(this), |
| 250 Details<const User>(&user)); | 250 Details<const User>(&user)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 // Private constructor and destructor. Do nothing. | 253 // Private constructor and destructor. Do nothing. |
| 254 UserManager::UserManager() | 254 UserManager::UserManager() |
| 255 : ALLOW_THIS_IN_INITIALIZER_LIST(image_loader_(new UserImageLoader(this))), | 255 : ALLOW_THIS_IN_INITIALIZER_LIST(image_loader_(new UserImageLoader(this))), |
| 256 current_user_is_owner_(false) { | 256 current_user_is_owner_(false) { |
| 257 registrar_.Add(this, NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, | 257 registrar_.Add(this, NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, |
| 258 NotificationService::AllSources()); | 258 NotificationService::AllSources()); |
| 259 registrar_.Add(this, NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED, | |
| 260 NotificationService::AllSources()); | |
| 261 } | 259 } |
| 262 | 260 |
| 263 UserManager::~UserManager() { | 261 UserManager::~UserManager() { |
| 264 image_loader_->set_delegate(NULL); | 262 image_loader_->set_delegate(NULL); |
| 265 } | 263 } |
| 266 | 264 |
| 267 void UserManager::NotifyOnLogin() { | 265 void UserManager::NotifyOnLogin() { |
| 268 NotificationService::current()->Notify( | 266 NotificationService::current()->Notify( |
| 269 NotificationType::LOGIN_USER_CHANGED, | 267 NotificationType::LOGIN_USER_CHANGED, |
| 270 Source<UserManager>(this), | 268 Source<UserManager>(this), |
| 271 Details<const User>(&logged_in_user_)); | 269 Details<const User>(&logged_in_user_)); |
| 272 | 270 |
| 273 chromeos::CrosLibrary::Get()->GetInputMethodLibrary()-> | 271 chromeos::CrosLibrary::Get()->GetInputMethodLibrary()-> |
| 274 SetDeferImeStartup(false); | 272 SetDeferImeStartup(false); |
| 275 // Shut down the IME so that it will reload the user's settings. | 273 // Shut down the IME so that it will reload the user's settings. |
| 276 chromeos::CrosLibrary::Get()->GetInputMethodLibrary()-> | 274 chromeos::CrosLibrary::Get()->GetInputMethodLibrary()-> |
| 277 StopInputMethodProcesses(); | 275 StopInputMethodProcesses(); |
| 278 // Let the window manager know that we're logged in now. | 276 // Let the window manager know that we're logged in now. |
| 279 WmIpc::instance()->SetLoggedInProperty(true); | 277 WmIpc::instance()->SetLoggedInProperty(true); |
| 280 | 278 |
| 281 // Schedules current user ownership check on file thread. | 279 // Schedules current user ownership check on file thread. |
| 282 ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, | 280 ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, |
| 283 NewRunnableFunction(&CheckOwnership)); | 281 NewRunnableFunction(&CheckOwnership)); |
| 284 } | 282 } |
| 285 | 283 |
| 286 void UserManager::Observe(NotificationType type, | 284 void UserManager::Observe(NotificationType type, |
| 287 const NotificationSource& source, | 285 const NotificationSource& source, |
| 288 const NotificationDetails& details) { | 286 const NotificationDetails& details) { |
| 289 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED || | 287 if (type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { |
| 290 type == NotificationType::OWNER_KEY_FETCH_ATTEMPT_FAILED) { | |
| 291 ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, | 288 ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, |
| 292 NewRunnableFunction(&CheckOwnership)); | 289 NewRunnableFunction(&CheckOwnership)); |
| 293 } | 290 } |
| 294 } | 291 } |
| 295 | 292 |
| 296 } // namespace chromeos | 293 } // namespace chromeos |
| OLD | NEW |