| 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/settings/device_settings_service.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "chrome/browser/chrome_notification_types.h" | 12 #include "chrome/browser/chrome_notification_types.h" |
| 13 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 13 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| 14 #include "chrome/browser/chromeos/settings/owner_key_util.h" | |
| 15 #include "chrome/browser/chromeos/settings/session_manager_operation.h" | 14 #include "chrome/browser/chromeos/settings/session_manager_operation.h" |
| 15 #include "components/ownership/owner_key_util.h" |
| 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 20 #include "crypto/rsa_private_key.h" | 20 #include "crypto/rsa_private_key.h" |
| 21 | 21 |
| 22 namespace em = enterprise_management; | 22 namespace em = enterprise_management; |
| 23 | 23 |
| 24 using ownership::OwnerKeyUtil; |
| 25 using ownership::PublicKey; |
| 26 |
| 24 namespace { | 27 namespace { |
| 25 | 28 |
| 26 // Delay between load retries when there was a validation error. | 29 // Delay between load retries when there was a validation error. |
| 27 // NOTE: This code is here to mitigate clock loss on some devices where policy | 30 // NOTE: This code is here to mitigate clock loss on some devices where policy |
| 28 // loads will fail with a validation error caused by RTC clock being reset when | 31 // loads will fail with a validation error caused by RTC clock being reset when |
| 29 // the battery is drained. | 32 // the battery is drained. |
| 30 int kLoadRetryDelayMs = 1000 * 5; | 33 int kLoadRetryDelayMs = 1000 * 5; |
| 31 // Maximal number of retries before we give up. Calculated to allow for 10 min | 34 // Maximal number of retries before we give up. Calculated to allow for 10 min |
| 32 // of retry time. | 35 // of retry time. |
| 33 int kMaxLoadRetries = (1000 * 60 * 10) / kLoadRetryDelayMs; | 36 int kMaxLoadRetries = (1000 * 60 * 10) / kLoadRetryDelayMs; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 DeviceSettingsService::Initialize(); | 352 DeviceSettingsService::Initialize(); |
| 350 } | 353 } |
| 351 | 354 |
| 352 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { | 355 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { |
| 353 // Clean pending operations. | 356 // Clean pending operations. |
| 354 DeviceSettingsService::Get()->UnsetSessionManager(); | 357 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 355 DeviceSettingsService::Shutdown(); | 358 DeviceSettingsService::Shutdown(); |
| 356 } | 359 } |
| 357 | 360 |
| 358 } // namespace chromeos | 361 } // namespace chromeos |
| OLD | NEW |