| 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/policy/browser_policy_connector.h" | 5 #include "chrome/browser/policy/browser_policy_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 #if defined(OS_CHROMEOS) | 176 #if defined(OS_CHROMEOS) |
| 177 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); | 177 return install_attributes_.get() && install_attributes_->IsEnterpriseDevice(); |
| 178 #else | 178 #else |
| 179 return false; | 179 return false; |
| 180 #endif | 180 #endif |
| 181 } | 181 } |
| 182 | 182 |
| 183 EnterpriseInstallAttributes::LockResult | 183 EnterpriseInstallAttributes::LockResult |
| 184 BrowserPolicyConnector::LockDevice(const std::string& user) { | 184 BrowserPolicyConnector::LockDevice(const std::string& user) { |
| 185 #if defined(OS_CHROMEOS) | 185 #if defined(OS_CHROMEOS) |
| 186 if (install_attributes_.get()) | 186 if (install_attributes_.get()) { |
| 187 return install_attributes_->LockDevice(user); | 187 return install_attributes_->LockDevice(user, |
| 188 device_data_store_->device_mode(), |
| 189 device_data_store_->device_id()); |
| 190 } |
| 188 #endif | 191 #endif |
| 189 | 192 |
| 190 return EnterpriseInstallAttributes::LOCK_BACKEND_ERROR; | 193 return EnterpriseInstallAttributes::LOCK_BACKEND_ERROR; |
| 191 } | 194 } |
| 192 | 195 |
| 193 // static | 196 // static |
| 194 std::string BrowserPolicyConnector::GetSerialNumber() { | 197 std::string BrowserPolicyConnector::GetSerialNumber() { |
| 195 std::string serial_number; | 198 std::string serial_number; |
| 196 #if defined(OS_CHROMEOS) | 199 #if defined(OS_CHROMEOS) |
| 197 chromeos::system::StatisticsProvider* provider = | 200 chromeos::system::StatisticsProvider* provider = |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 if (user_cloud_policy_subsystem_.get()) { | 334 if (user_cloud_policy_subsystem_.get()) { |
| 332 user_cloud_policy_subsystem_->GetCloudPolicyCacheBase()-> | 335 user_cloud_policy_subsystem_->GetCloudPolicyCacheBase()-> |
| 333 SetFetchingDone(); | 336 SetFetchingDone(); |
| 334 } | 337 } |
| 335 } else { | 338 } else { |
| 336 if (user_data_store_.get()) | 339 if (user_data_store_.get()) |
| 337 user_data_store_->SetOAuthToken(oauth_token); | 340 user_data_store_->SetOAuthToken(oauth_token); |
| 338 } | 341 } |
| 339 } | 342 } |
| 340 | 343 |
| 341 const CloudPolicyDataStore* | 344 CloudPolicyDataStore* BrowserPolicyConnector::GetDeviceCloudPolicyDataStore() { |
| 342 BrowserPolicyConnector::GetDeviceCloudPolicyDataStore() const { | |
| 343 #if defined(OS_CHROMEOS) | 345 #if defined(OS_CHROMEOS) |
| 344 return device_data_store_.get(); | 346 return device_data_store_.get(); |
| 345 #else | 347 #else |
| 346 return NULL; | 348 return NULL; |
| 347 #endif | 349 #endif |
| 348 } | 350 } |
| 349 | 351 |
| 350 const CloudPolicyDataStore* | 352 CloudPolicyDataStore* BrowserPolicyConnector::GetUserCloudPolicyDataStore() { |
| 351 BrowserPolicyConnector::GetUserCloudPolicyDataStore() const { | |
| 352 return user_data_store_.get(); | 353 return user_data_store_.get(); |
| 353 } | 354 } |
| 354 | 355 |
| 355 const ConfigurationPolicyHandlerList* | 356 const ConfigurationPolicyHandlerList* |
| 356 BrowserPolicyConnector::GetHandlerList() const { | 357 BrowserPolicyConnector::GetHandlerList() const { |
| 357 return &handler_list_; | 358 return &handler_list_; |
| 358 } | 359 } |
| 359 | 360 |
| 360 UserAffiliation BrowserPolicyConnector::GetUserAffiliation( | 361 UserAffiliation BrowserPolicyConnector::GetUserAffiliation( |
| 361 const std::string& user_name) { | 362 const std::string& user_name) { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); | 511 config_dir_path.Append(FILE_PATH_LITERAL("recommended"))); |
| 511 } else { | 512 } else { |
| 512 return NULL; | 513 return NULL; |
| 513 } | 514 } |
| 514 #else | 515 #else |
| 515 return NULL; | 516 return NULL; |
| 516 #endif | 517 #endif |
| 517 } | 518 } |
| 518 | 519 |
| 519 } // namespace policy | 520 } // namespace policy |
| OLD | NEW |