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/chromeos/login/screens/chrome_user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/chrome_user_selection_screen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 device_local_account_policy_service_->AddObserver(this); | 44 device_local_account_policy_service_->AddObserver(this); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 ChromeUserSelectionScreen::~ChromeUserSelectionScreen() { | 48 ChromeUserSelectionScreen::~ChromeUserSelectionScreen() { |
49 if (device_local_account_policy_service_) { | 49 if (device_local_account_policy_service_) { |
50 device_local_account_policy_service_->RemoveObserver(this); | 50 device_local_account_policy_service_->RemoveObserver(this); |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 void ChromeUserSelectionScreen::Init(const user_manager::UserList& users, | 54 void ChromeUserSelectionScreen::Init(const user_manager::UserList& users) { |
55 bool show_guest) { | 55 UserSelectionScreen::Init(users); |
56 UserSelectionScreen::Init(users, show_guest); | |
57 | 56 |
58 // Retrieve the current policy for all users. | 57 // Retrieve the current policy for all users. |
59 for (user_manager::UserList::const_iterator it = users.begin(); | 58 for (user_manager::UserList::const_iterator it = users.begin(); |
60 it != users.end(); ++it) { | 59 it != users.end(); ++it) { |
61 if ((*it)->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) | 60 if ((*it)->GetType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) |
62 OnPolicyUpdated((*it)->GetAccountId().GetUserEmail()); | 61 OnPolicyUpdated((*it)->GetAccountId().GetUserEmail()); |
63 } | 62 } |
64 } | 63 } |
65 | 64 |
66 void ChromeUserSelectionScreen::SendUserList() { | 65 void ChromeUserSelectionScreen::SendUserList() { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // advanced form (two or more recommended locales). | 187 // advanced form (two or more recommended locales). |
189 const bool two_or_more_recommended_locales = recommended_locales.size() >= 2; | 188 const bool two_or_more_recommended_locales = recommended_locales.size() >= 2; |
190 | 189 |
191 // Notify the UI. | 190 // Notify the UI. |
192 view_->SetPublicSessionLocales(account_id, std::move(available_locales), | 191 view_->SetPublicSessionLocales(account_id, std::move(available_locales), |
193 default_locale, | 192 default_locale, |
194 two_or_more_recommended_locales); | 193 two_or_more_recommended_locales); |
195 } | 194 } |
196 | 195 |
197 } // namespace chromeos | 196 } // namespace chromeos |
OLD | NEW |