| Index: chrome/browser/chromeos/policy/device_status_collector.cc
|
| diff --git a/chrome/browser/chromeos/policy/device_status_collector.cc b/chrome/browser/chromeos/policy/device_status_collector.cc
|
| index 1266e22e7ef89ca768353ec26b9c72467e33eb6e..4b664e68fde3975d3f621461940c3668bf669db1 100644
|
| --- a/chrome/browser/chromeos/policy/device_status_collector.cc
|
| +++ b/chrome/browser/chromeos/policy/device_status_collector.cc
|
| @@ -7,8 +7,10 @@
|
| #include <stddef.h>
|
| #include <stdint.h>
|
| #include <sys/statvfs.h>
|
| +
|
| #include <cstdio>
|
| #include <limits>
|
| +#include <memory>
|
| #include <sstream>
|
|
|
| #include "base/bind.h"
|
| @@ -19,7 +21,7 @@
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/posix/eintr_wrapper.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/string_util.h"
|
| @@ -213,10 +215,10 @@ std::vector<em::CPUTempInfo> ReadCPUTempInfo() {
|
| // Returns null if there is no active kiosk session, or if that kiosk
|
| // session has been removed from policy since the session started, in which
|
| // case we won't report its status).
|
| -scoped_ptr<policy::DeviceLocalAccount>
|
| -GetCurrentKioskDeviceLocalAccount(chromeos::CrosSettings* settings) {
|
| +std::unique_ptr<policy::DeviceLocalAccount> GetCurrentKioskDeviceLocalAccount(
|
| + chromeos::CrosSettings* settings) {
|
| if (!user_manager::UserManager::Get()->IsLoggedInAsKioskApp())
|
| - return scoped_ptr<policy::DeviceLocalAccount>();
|
| + return std::unique_ptr<policy::DeviceLocalAccount>();
|
| const user_manager::User* const user =
|
| user_manager::UserManager::Get()->GetActiveUser();
|
| const std::vector<policy::DeviceLocalAccount> accounts =
|
| @@ -225,12 +227,12 @@ GetCurrentKioskDeviceLocalAccount(chromeos::CrosSettings* settings) {
|
| for (const auto& device_local_account : accounts) {
|
| if (AccountId::FromUserEmail(device_local_account.user_id) ==
|
| user->GetAccountId()) {
|
| - return make_scoped_ptr(
|
| + return base::WrapUnique(
|
| new policy::DeviceLocalAccount(device_local_account));
|
| }
|
| }
|
| LOG(WARNING) << "Kiosk app not found in list of device-local accounts";
|
| - return scoped_ptr<policy::DeviceLocalAccount>();
|
| + return std::unique_ptr<policy::DeviceLocalAccount>();
|
| }
|
|
|
| } // namespace
|
| @@ -455,7 +457,7 @@ void DeviceStatusCollector::TrimStoredActivityPeriods(int64_t min_day_key,
|
| const base::DictionaryValue* activity_times =
|
| local_state_->GetDictionary(prefs::kDeviceActivityTimes);
|
|
|
| - scoped_ptr<base::DictionaryValue> copy(activity_times->DeepCopy());
|
| + std::unique_ptr<base::DictionaryValue> copy(activity_times->DeepCopy());
|
| for (base::DictionaryValue::Iterator it(*activity_times); !it.IsAtEnd();
|
| it.Advance()) {
|
| int64_t timestamp;
|
| @@ -531,9 +533,9 @@ void DeviceStatusCollector::IdleStateCallback(ui::IdleState state) {
|
| last_idle_check_ = now;
|
| }
|
|
|
| -scoped_ptr<DeviceLocalAccount>
|
| +std::unique_ptr<DeviceLocalAccount>
|
| DeviceStatusCollector::GetAutoLaunchedKioskSessionInfo() {
|
| - scoped_ptr<DeviceLocalAccount> account =
|
| + std::unique_ptr<DeviceLocalAccount> account =
|
| GetCurrentKioskDeviceLocalAccount(cros_settings_);
|
| if (account) {
|
| chromeos::KioskAppManager::App current_app;
|
| @@ -544,7 +546,7 @@ DeviceStatusCollector::GetAutoLaunchedKioskSessionInfo() {
|
| }
|
| }
|
| // No auto-launched kiosk session active.
|
| - return scoped_ptr<DeviceLocalAccount>();
|
| + return std::unique_ptr<DeviceLocalAccount>();
|
| }
|
|
|
| void DeviceStatusCollector::SampleHardwareStatus() {
|
| @@ -941,7 +943,7 @@ bool DeviceStatusCollector::GetDeviceSessionStatus(
|
| if (!report_session_status_)
|
| return false;
|
|
|
| - scoped_ptr<const DeviceLocalAccount> account =
|
| + std::unique_ptr<const DeviceLocalAccount> account =
|
| GetAutoLaunchedKioskSessionInfo();
|
| // Only generate session status reports if we are in an auto-launched kiosk
|
| // session.
|
|
|