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

Side by Side Diff: chrome/browser/chromeos/policy/device_status_collector.cc

Issue 1412813003: This CL replaces user_manager::UserID with AccountId. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@468875--Chrome-OS-handles-deletion-of-Gmail-account-poorly--Create-AccountID-structure-part2--user_names
Patch Set: Fix Win GN build. Created 5 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/policy/device_status_collector.h" 5 #include "chrome/browser/chromeos/policy/device_status_collector.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <cstdio> 8 #include <cstdio>
9 #include <limits> 9 #include <limits>
10 #include <sstream> 10 #include <sstream>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // Returns the DeviceLocalAccount associated with the current kiosk session. 209 // Returns the DeviceLocalAccount associated with the current kiosk session.
210 // Returns null if there is no active kiosk session, or if that kiosk 210 // Returns null if there is no active kiosk session, or if that kiosk
211 // session has been removed from policy since the session started, in which 211 // session has been removed from policy since the session started, in which
212 // case we won't report its status). 212 // case we won't report its status).
213 scoped_ptr<policy::DeviceLocalAccount> 213 scoped_ptr<policy::DeviceLocalAccount>
214 GetCurrentKioskDeviceLocalAccount(chromeos::CrosSettings* settings) { 214 GetCurrentKioskDeviceLocalAccount(chromeos::CrosSettings* settings) {
215 if (!user_manager::UserManager::Get()->IsLoggedInAsKioskApp()) 215 if (!user_manager::UserManager::Get()->IsLoggedInAsKioskApp())
216 return scoped_ptr<policy::DeviceLocalAccount>(); 216 return scoped_ptr<policy::DeviceLocalAccount>();
217 const user_manager::User* const user = 217 const user_manager::User* const user =
218 user_manager::UserManager::Get()->GetActiveUser(); 218 user_manager::UserManager::Get()->GetActiveUser();
219 const std::string user_id = user->GetUserID();
220 const std::vector<policy::DeviceLocalAccount> accounts = 219 const std::vector<policy::DeviceLocalAccount> accounts =
221 policy::GetDeviceLocalAccounts(settings); 220 policy::GetDeviceLocalAccounts(settings);
222 221
223 for (const auto& device_local_account : accounts) { 222 for (const auto& device_local_account : accounts) {
224 if (device_local_account.user_id == user_id) { 223 if (AccountId::FromUserEmail(device_local_account.user_id) ==
224 user->GetAccountId()) {
225 return make_scoped_ptr( 225 return make_scoped_ptr(
226 new policy::DeviceLocalAccount(device_local_account)).Pass(); 226 new policy::DeviceLocalAccount(device_local_account)).Pass();
227 } 227 }
228 } 228 }
229 LOG(WARNING) << "Kiosk app not found in list of device-local accounts"; 229 LOG(WARNING) << "Kiosk app not found in list of device-local accounts";
230 return scoped_ptr<policy::DeviceLocalAccount>(); 230 return scoped_ptr<policy::DeviceLocalAccount>();
231 } 231 }
232 232
233 } // namespace 233 } // namespace
234 234
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 ScheduleGeolocationUpdateRequest(); 1046 ScheduleGeolocationUpdateRequest();
1047 } 1047 }
1048 1048
1049 void DeviceStatusCollector::ReceiveVolumeInfo( 1049 void DeviceStatusCollector::ReceiveVolumeInfo(
1050 const std::vector<em::VolumeInfo>& info) { 1050 const std::vector<em::VolumeInfo>& info) {
1051 if (report_hardware_status_) 1051 if (report_hardware_status_)
1052 volume_info_ = info; 1052 volume_info_ = info;
1053 } 1053 }
1054 1054
1055 } // namespace policy 1055 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698