| OLD | NEW |
| 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 "components/policy/core/browser/browser_policy_connector.h" | 5 #include "components/policy/core/browser/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | |
| 9 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
| 16 #include "base/metrics/sparse_histogram.h" | 16 #include "base/metrics/sparse_histogram.h" |
| 17 #include "base/prefs/pref_registry_simple.h" | 17 #include "base/prefs/pref_registry_simple.h" |
| 18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 BrowserPolicyConnector::~BrowserPolicyConnector() { | 98 BrowserPolicyConnector::~BrowserPolicyConnector() { |
| 99 } | 99 } |
| 100 | 100 |
| 101 void BrowserPolicyConnector::InitInternal( | 101 void BrowserPolicyConnector::InitInternal( |
| 102 PrefService* local_state, | 102 PrefService* local_state, |
| 103 scoped_ptr<DeviceManagementService> device_management_service) { | 103 scoped_ptr<DeviceManagementService> device_management_service) { |
| 104 DCHECK(!is_initialized()); | 104 DCHECK(!is_initialized()); |
| 105 | 105 |
| 106 device_management_service_ = device_management_service.Pass(); | 106 device_management_service_ = std::move(device_management_service); |
| 107 | 107 |
| 108 policy_statistics_collector_.reset(new policy::PolicyStatisticsCollector( | 108 policy_statistics_collector_.reset(new policy::PolicyStatisticsCollector( |
| 109 base::Bind(&GetChromePolicyDetails), GetChromeSchema(), | 109 base::Bind(&GetChromePolicyDetails), GetChromeSchema(), |
| 110 GetPolicyService(), local_state, | 110 GetPolicyService(), local_state, |
| 111 base::MessageLoop::current()->task_runner())); | 111 base::MessageLoop::current()->task_runner())); |
| 112 policy_statistics_collector_->Initialize(); | 112 policy_statistics_collector_->Initialize(); |
| 113 | 113 |
| 114 InitPolicyProviders(); | 114 InitPolicyProviders(); |
| 115 } | 115 } |
| 116 | 116 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // static | 158 // static |
| 159 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) { | 159 void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) { |
| 160 registry->RegisterIntegerPref( | 160 registry->RegisterIntegerPref( |
| 161 policy_prefs::kUserPolicyRefreshRate, | 161 policy_prefs::kUserPolicyRefreshRate, |
| 162 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs); | 162 CloudPolicyRefreshScheduler::kDefaultRefreshDelayMs); |
| 163 } | 163 } |
| 164 | 164 |
| 165 | 165 |
| 166 } // namespace policy | 166 } // namespace policy |
| OLD | NEW |