OLD | NEW |
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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 } | 425 } |
426 | 426 |
427 void DeviceStatusCollector::GetUsers(em::DeviceStatusReportRequest* request) { | 427 void DeviceStatusCollector::GetUsers(em::DeviceStatusReportRequest* request) { |
428 policy::BrowserPolicyConnectorChromeOS* connector = | 428 policy::BrowserPolicyConnectorChromeOS* connector = |
429 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 429 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
430 const user_manager::UserList& users = | 430 const user_manager::UserList& users = |
431 user_manager::UserManager::Get()->GetUsers(); | 431 user_manager::UserManager::Get()->GetUsers(); |
432 user_manager::UserList::const_iterator user; | 432 user_manager::UserList::const_iterator user; |
433 for (user = users.begin(); user != users.end(); ++user) { | 433 for (user = users.begin(); user != users.end(); ++user) { |
434 // Only regular users are reported. | 434 // Only regular users are reported. |
435 if ((*user)->GetType() != user_manager::USER_TYPE_REGULAR) | 435 if ((*user)->IsRegular()) |
436 continue; | 436 continue; |
437 | 437 |
438 em::DeviceUser* device_user = request->add_user(); | 438 em::DeviceUser* device_user = request->add_user(); |
439 const std::string& email = (*user)->email(); | 439 const std::string& email = (*user)->email(); |
440 if (connector->GetUserAffiliation(email) == USER_AFFILIATION_MANAGED) { | 440 if (connector->GetUserAffiliation(email) == USER_AFFILIATION_MANAGED) { |
441 device_user->set_type(em::DeviceUser::USER_TYPE_MANAGED); | 441 device_user->set_type(em::DeviceUser::USER_TYPE_MANAGED); |
442 device_user->set_email(email); | 442 device_user->set_email(email); |
443 } else { | 443 } else { |
444 device_user->set_type(em::DeviceUser::USER_TYPE_UNMANAGED); | 444 device_user->set_type(em::DeviceUser::USER_TYPE_UNMANAGED); |
445 // Do not report the email address of unmanaged users. | 445 // Do not report the email address of unmanaged users. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 location.SetDouble(kSpeed, position.speed); | 549 location.SetDouble(kSpeed, position.speed); |
550 location.SetString(kTimestamp, | 550 location.SetString(kTimestamp, |
551 base::Int64ToString(position.timestamp.ToInternalValue())); | 551 base::Int64ToString(position.timestamp.ToInternalValue())); |
552 local_state_->Set(prefs::kDeviceLocation, location); | 552 local_state_->Set(prefs::kDeviceLocation, location); |
553 } | 553 } |
554 | 554 |
555 ScheduleGeolocationUpdateRequest(); | 555 ScheduleGeolocationUpdateRequest(); |
556 } | 556 } |
557 | 557 |
558 } // namespace policy | 558 } // namespace policy |
OLD | NEW |