| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/chromeos/login/user_image_downloader.h" | 13 #include "chrome/browser/chromeos/login/user_image_downloader.h" |
| 14 #include "chrome/browser/chromeos/wm_ipc.h" |
| 14 #include "chrome/browser/pref_service.h" | 15 #include "chrome/browser/pref_service.h" |
| 15 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
| 16 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
| 17 | 18 |
| 18 namespace chromeos { | 19 namespace chromeos { |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 // A vector pref of the users who have logged into the device. | 23 // A vector pref of the users who have logged into the device. |
| 23 const wchar_t kLoggedInUsers[] = L"LoggedInUsers"; | 24 const wchar_t kLoggedInUsers[] = L"LoggedInUsers"; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 logged_in_user_ = *it; | 120 logged_in_user_ = *it; |
| 120 } | 121 } |
| 121 } | 122 } |
| 122 prefs->ScheduleSavePersistentPrefs(); | 123 prefs->ScheduleSavePersistentPrefs(); |
| 123 User user; | 124 User user; |
| 124 user.set_email(email); | 125 user.set_email(email); |
| 125 NotificationService::current()->Notify( | 126 NotificationService::current()->Notify( |
| 126 NotificationType::LOGIN_USER_CHANGED, | 127 NotificationType::LOGIN_USER_CHANGED, |
| 127 Source<UserManager>(this), | 128 Source<UserManager>(this), |
| 128 Details<const User>(&logged_in_user_)); | 129 Details<const User>(&logged_in_user_)); |
| 130 |
| 131 // Let the window manager know that we're logged in now. |
| 132 WmIpc::instance()->SetLoggedInProperty(true); |
| 129 } | 133 } |
| 130 | 134 |
| 131 void UserManager::DownloadUserImage(const std::string& username) { | 135 void UserManager::DownloadUserImage(const std::string& username) { |
| 132 LOG(INFO) << "Downloading image for user " << username; | 136 LOG(INFO) << "Downloading image for user " << username; |
| 133 image_downloader_ = new UserImageDownloader(username); | 137 image_downloader_ = new UserImageDownloader(username); |
| 134 } | 138 } |
| 135 | 139 |
| 136 void UserManager::SaveUserImagePath(const std::string& username, | 140 void UserManager::SaveUserImagePath(const std::string& username, |
| 137 const std::string& image_path) { | 141 const std::string& image_path) { |
| 138 LOG(INFO) << "Saving " << username << " image path to " << image_path; | 142 LOG(INFO) << "Saving " << username << " image path to " << image_path; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 159 // Private constructor and destructor. Do nothing. | 163 // Private constructor and destructor. Do nothing. |
| 160 UserManager::UserManager() | 164 UserManager::UserManager() |
| 161 : ALLOW_THIS_IN_INITIALIZER_LIST(image_loader_(new UserImageLoader(this))) { | 165 : ALLOW_THIS_IN_INITIALIZER_LIST(image_loader_(new UserImageLoader(this))) { |
| 162 } | 166 } |
| 163 | 167 |
| 164 UserManager::~UserManager() { | 168 UserManager::~UserManager() { |
| 165 image_loader_->set_delegate(NULL); | 169 image_loader_->set_delegate(NULL); |
| 166 } | 170 } |
| 167 | 171 |
| 168 } // namespace chromeos | 172 } // namespace chromeos |
| OLD | NEW |