Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: chrome/browser/chromeos/login/screens/chrome_user_selection_screen.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698