OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 #endif | 132 #endif |
133 } | 133 } |
134 | 134 |
135 // static | 135 // static |
136 void BrowserPolicyConnector::RegisterPrefs(PrefService* local_state) { | 136 void BrowserPolicyConnector::RegisterPrefs(PrefService* local_state) { |
137 local_state->RegisterIntegerPref(prefs::kPolicyDevicePolicyRefreshRate, | 137 local_state->RegisterIntegerPref(prefs::kPolicyDevicePolicyRefreshRate, |
138 kDefaultPolicyRefreshRateInMilliseconds); | 138 kDefaultPolicyRefreshRateInMilliseconds); |
139 } | 139 } |
140 | 140 |
141 void BrowserPolicyConnector::SetCredentials(const std::string& owner_email, | 141 void BrowserPolicyConnector::SetCredentials(const std::string& owner_email, |
142 const std::string& gaia_token, | 142 const std::string& gaia_token) { |
143 const std::string& machine_id) { | |
144 #if defined(OS_CHROMEOS) | 143 #if defined(OS_CHROMEOS) |
145 if (identity_strategy_.get()) | 144 if (identity_strategy_.get()) |
146 identity_strategy_->SetAuthCredentials(owner_email, gaia_token, machine_id); | 145 identity_strategy_->SetAuthCredentials(owner_email, gaia_token); |
147 #endif | 146 #endif |
148 } | 147 } |
149 | 148 |
150 bool BrowserPolicyConnector::IsEnterpriseManaged() { | 149 bool BrowserPolicyConnector::IsEnterpriseManaged() { |
151 #if defined(OS_CHROMEOS) | 150 #if defined(OS_CHROMEOS) |
152 return (identity_strategy_.get() && | 151 return (identity_strategy_.get() && |
153 !identity_strategy_->GetDeviceToken().empty()); | 152 !identity_strategy_->GetDeviceToken().empty()); |
154 #else | 153 #else |
155 return false; | 154 return false; |
156 #endif | 155 #endif |
(...skipping 22 matching lines...) Expand all Loading... |
179 DCHECK(local_state); | 178 DCHECK(local_state); |
180 DCHECK(request_context); | 179 DCHECK(request_context); |
181 if (cloud_policy_subsystem_.get()) { | 180 if (cloud_policy_subsystem_.get()) { |
182 cloud_policy_subsystem_->Initialize(local_state, | 181 cloud_policy_subsystem_->Initialize(local_state, |
183 prefs::kPolicyDevicePolicyRefreshRate, | 182 prefs::kPolicyDevicePolicyRefreshRate, |
184 request_context); | 183 request_context); |
185 } | 184 } |
186 } | 185 } |
187 | 186 |
188 } // namespace | 187 } // namespace |
OLD | NEW |