OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/chromeos/manager_password_service.h" | 5 #include "chrome/browser/supervised_user/chromeos/manager_password_service.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h
" | 11 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
12 #include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" | 12 #include "chrome/browser/chromeos/login/supervised/supervised_user_constants.h" |
13 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 13 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
14 #include "chrome/browser/chromeos/login/users/user.h" | 14 #include "chrome/browser/chromeos/login/users/user.h" |
15 #include "chrome/browser/chromeos/login/users/user_manager.h" | 15 #include "chrome/browser/chromeos/login/users/user_manager.h" |
16 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 16 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
17 #include "chrome/browser/supervised_user/supervised_user_sync_service.h" | 17 #include "chrome/browser/supervised_user/supervised_user_sync_service.h" |
18 #include "chromeos/login/auth/key.h" | 18 #include "chromeos/login/auth/key.h" |
19 #include "chromeos/login/auth/user_context.h" | 19 #include "chromeos/login/auth/user_context.h" |
20 #include "components/user_manager/user_type.h" | 20 #include "components/user_manager/user_type.h" |
21 | 21 |
22 namespace chromeos { | 22 namespace chromeos { |
(...skipping 16 matching lines...) Expand all Loading... |
39 authenticator_ = new ExtendedAuthenticator(this); | 39 authenticator_ = new ExtendedAuthenticator(this); |
40 | 40 |
41 UserManager* user_manager = UserManager::Get(); | 41 UserManager* user_manager = UserManager::Get(); |
42 | 42 |
43 SupervisedUserManager* supervised_user_manager = | 43 SupervisedUserManager* supervised_user_manager = |
44 user_manager->GetSupervisedUserManager(); | 44 user_manager->GetSupervisedUserManager(); |
45 | 45 |
46 const UserList& users = user_manager->GetUsers(); | 46 const UserList& users = user_manager->GetUsers(); |
47 | 47 |
48 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { | 48 for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { |
49 if ((*it)->GetType() != user_manager::USER_TYPE_LOCALLY_MANAGED) | 49 if ((*it)->GetType() != user_manager::USER_TYPE_SUPERVISED) |
50 continue; | 50 continue; |
51 if (user_id != supervised_user_manager->GetManagerUserId((*it)->email())) | 51 if (user_id != supervised_user_manager->GetManagerUserId((*it)->email())) |
52 continue; | 52 continue; |
53 OnSharedSettingsChange( | 53 OnSharedSettingsChange( |
54 supervised_user_manager->GetUserSyncId((*it)->email()), | 54 supervised_user_manager->GetUserSyncId((*it)->email()), |
55 supervised_users::kChromeOSPasswordData); | 55 supervised_users::kChromeOSPasswordData); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 void ManagerPasswordService::OnSharedSettingsChange( | 59 void ManagerPasswordService::OnSharedSettingsChange( |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 void ManagerPasswordService::OnOldManagerKeyDeleted( | 261 void ManagerPasswordService::OnOldManagerKeyDeleted( |
262 const UserContext& master_key_context) { | 262 const UserContext& master_key_context) { |
263 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID(); | 263 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID(); |
264 } | 264 } |
265 | 265 |
266 void ManagerPasswordService::Shutdown() { | 266 void ManagerPasswordService::Shutdown() { |
267 settings_service_subscription_.reset(); | 267 settings_service_subscription_.reset(); |
268 } | 268 } |
269 | 269 |
270 } // namespace chromeos | 270 } // namespace chromeos |
OLD | NEW |