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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Parse the list of recommended locales set by policy. | 125 // Parse the list of recommended locales set by policy. |
126 std::vector<std::string> new_recommended_locales; | 126 std::vector<std::string> new_recommended_locales; |
127 base::ListValue const* list = NULL; | 127 base::ListValue const* list = NULL; |
128 if (entry && | 128 if (entry && |
129 entry->level == policy::POLICY_LEVEL_RECOMMENDED && | 129 entry->level == policy::POLICY_LEVEL_RECOMMENDED && |
130 entry->value && | 130 entry->value && |
131 entry->value->GetAsList(&list)) { | 131 entry->value->GetAsList(&list)) { |
132 for (base::ListValue::const_iterator it = list->begin(); it != list->end(); | 132 for (base::ListValue::const_iterator it = list->begin(); it != list->end(); |
133 ++it) { | 133 ++it) { |
134 std::string locale; | 134 std::string locale; |
135 if (!it->GetAsString(&locale)) { | 135 if (!(*it)->GetAsString(&locale)) { |
136 NOTREACHED(); | 136 NOTREACHED(); |
137 new_recommended_locales.clear(); | 137 new_recommended_locales.clear(); |
138 break; | 138 break; |
139 } | 139 } |
140 new_recommended_locales.push_back(locale); | 140 new_recommended_locales.push_back(locale); |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 std::vector<std::string>& recommended_locales = | 144 std::vector<std::string>& recommended_locales = |
145 public_session_recommended_locales_[account_id]; | 145 public_session_recommended_locales_[account_id]; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // advanced form (two or more recommended locales). | 188 // advanced form (two or more recommended locales). |
189 const bool two_or_more_recommended_locales = recommended_locales.size() >= 2; | 189 const bool two_or_more_recommended_locales = recommended_locales.size() >= 2; |
190 | 190 |
191 // Notify the UI. | 191 // Notify the UI. |
192 view_->SetPublicSessionLocales(account_id, std::move(available_locales), | 192 view_->SetPublicSessionLocales(account_id, std::move(available_locales), |
193 default_locale, | 193 default_locale, |
194 two_or_more_recommended_locales); | 194 two_or_more_recommended_locales); |
195 } | 195 } |
196 | 196 |
197 } // namespace chromeos | 197 } // namespace chromeos |
OLD | NEW |