Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4734)

Unified Diff: chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.cc

Issue 789793005: Revert of Clean up Smart Lock cryptohome keys logic: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.cc
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.cc
deleted file mode 100644
index 0b98a6acc88ee45c200e7adaef5d728e0bc5b174..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/bind.h"
-#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_create_keys_operation.h"
-#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_refresh_keys_operation.h"
-#include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_remove_keys_operation.h"
-
-namespace chromeos {
-
-EasyUnlockRefreshKeysOperation::EasyUnlockRefreshKeysOperation(
- const UserContext& user_context,
- const std::string& tpm_public_key,
- const EasyUnlockDeviceKeyDataList& devices,
- const RefreshKeysCallback& callback)
- : user_context_(user_context),
- tpm_public_key_(tpm_public_key),
- devices_(devices),
- callback_(callback),
- weak_ptr_factory_(this) {
-}
-
-EasyUnlockRefreshKeysOperation::~EasyUnlockRefreshKeysOperation() {
-}
-
-void EasyUnlockRefreshKeysOperation::Start() {
- if (devices_.empty()) {
- OnKeysCreated(true);
- return;
- }
-
- create_keys_operation_.reset(new EasyUnlockCreateKeysOperation(
- user_context_, tpm_public_key_, devices_,
- base::Bind(&EasyUnlockRefreshKeysOperation::OnKeysCreated,
- weak_ptr_factory_.GetWeakPtr())));
- create_keys_operation_->Start();
-}
-
-void EasyUnlockRefreshKeysOperation::OnKeysCreated(bool success) {
- if (!success) {
- callback_.Run(false);
- return;
- }
-
- // Update the user context to have the new authorization key after the create
- // keys operation. This is necessary because the old authorization key
- // associated with the user context will be invalidated after the create keys
- // operation.
- if (create_keys_operation_)
- user_context_ = create_keys_operation_->user_context();
-
- remove_keys_operation_.reset(new EasyUnlockRemoveKeysOperation(
- user_context_, devices_.size(),
- base::Bind(&EasyUnlockRefreshKeysOperation::OnKeysRemoved,
- weak_ptr_factory_.GetWeakPtr())));
- remove_keys_operation_->Start();
-}
-
-void EasyUnlockRefreshKeysOperation::OnKeysRemoved(bool success) {
- callback_.Run(success);
-}
-
-} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698