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/policy/user_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 policy_->set_device_id(device_id); | 402 policy_->set_device_id(device_id); |
403 } | 403 } |
404 | 404 |
405 // Tell the rest of the world that the policy load completed. | 405 // Tell the rest of the world that the policy load completed. |
406 NotifyStoreLoaded(); | 406 NotifyStoreLoaded(); |
407 } | 407 } |
408 | 408 |
409 // static | 409 // static |
410 void UserCloudPolicyStoreChromeOS::RemoveLegacyCacheDir( | 410 void UserCloudPolicyStoreChromeOS::RemoveLegacyCacheDir( |
411 const base::FilePath& dir) { | 411 const base::FilePath& dir) { |
412 if (file_util::PathExists(dir) && !file_util::Delete(dir, true)) | 412 if (file_util::PathExists(dir) && !base::Delete(dir, true)) |
413 LOG(ERROR) << "Failed to remove cache dir " << dir.value(); | 413 LOG(ERROR) << "Failed to remove cache dir " << dir.value(); |
414 } | 414 } |
415 | 415 |
416 void UserCloudPolicyStoreChromeOS::ReloadPolicyKey( | 416 void UserCloudPolicyStoreChromeOS::ReloadPolicyKey( |
417 const base::Closure& callback) { | 417 const base::Closure& callback) { |
418 std::vector<uint8>* key = new std::vector<uint8>(); | 418 std::vector<uint8>* key = new std::vector<uint8>(); |
419 content::BrowserThread::PostBlockingPoolTaskAndReply( | 419 content::BrowserThread::PostBlockingPoolTaskAndReply( |
420 FROM_HERE, | 420 FROM_HERE, |
421 base::Bind(&UserCloudPolicyStoreChromeOS::LoadPolicyKey, | 421 base::Bind(&UserCloudPolicyStoreChromeOS::LoadPolicyKey, |
422 policy_key_path_, | 422 policy_key_path_, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 !sanitized_username.empty()) { | 488 !sanitized_username.empty()) { |
489 policy_key_path_ = user_policy_key_dir_.Append( | 489 policy_key_path_ = user_policy_key_dir_.Append( |
490 base::StringPrintf(kPolicyKeyFile, sanitized_username.c_str())); | 490 base::StringPrintf(kPolicyKeyFile, sanitized_username.c_str())); |
491 } else { | 491 } else { |
492 SampleValidationFailure(VALIDATION_FAILURE_DBUS); | 492 SampleValidationFailure(VALIDATION_FAILURE_DBUS); |
493 } | 493 } |
494 ReloadPolicyKey(callback); | 494 ReloadPolicyKey(callback); |
495 } | 495 } |
496 | 496 |
497 } // namespace policy | 497 } // namespace policy |
OLD | NEW |