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

Side by Side Diff: chromeos/dbus/fake_cryptohome_client.cc

Issue 2082363004: Show notifications on low disk space. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@low-disk-strings
Patch Set: Show notifications on low disk space. Created 4 years, 5 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/dbus/fake_cryptohome_client.h" 5 #include "chromeos/dbus/fake_cryptohome_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const AsyncCallStatusWithDataHandler& data_handler) { 45 const AsyncCallStatusWithDataHandler& data_handler) {
46 async_call_status_handler_ = handler; 46 async_call_status_handler_ = handler;
47 async_call_status_data_handler_ = data_handler; 47 async_call_status_data_handler_ = data_handler;
48 } 48 }
49 49
50 void FakeCryptohomeClient::ResetAsyncCallStatusHandlers() { 50 void FakeCryptohomeClient::ResetAsyncCallStatusHandlers() {
51 async_call_status_handler_.Reset(); 51 async_call_status_handler_.Reset();
52 async_call_status_data_handler_.Reset(); 52 async_call_status_data_handler_.Reset();
53 } 53 }
54 54
55 void FakeCryptohomeClient::SetLowDiskSpaceHandler(
56 const LowDiskSpaceHandler& handler) {
57 low_disk_space_handler_ = handler;
58 }
59
60 void FakeCryptohomeClient::ResetLowDiskSpaceHandler() {
61 low_disk_space_handler_.Reset();
62 }
63
55 void FakeCryptohomeClient::WaitForServiceToBeAvailable( 64 void FakeCryptohomeClient::WaitForServiceToBeAvailable(
56 const WaitForServiceToBeAvailableCallback& callback) { 65 const WaitForServiceToBeAvailableCallback& callback) {
57 if (service_is_available_) { 66 if (service_is_available_) {
58 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 67 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
59 base::Bind(callback, true)); 68 base::Bind(callback, true));
60 } else { 69 } else {
61 pending_wait_for_service_to_be_available_callbacks_.push_back(callback); 70 pending_wait_for_service_to_be_available_callbacks_.push_back(callback);
62 } 71 }
63 } 72 }
64 73
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 cryptohome::MOUNT_ERROR_NONE)); 601 cryptohome::MOUNT_ERROR_NONE));
593 } else if (returns_data && !async_call_status_data_handler_.is_null()) { 602 } else if (returns_data && !async_call_status_data_handler_.is_null()) {
594 base::ThreadTaskRunnerHandle::Get()->PostTask( 603 base::ThreadTaskRunnerHandle::Get()->PostTask(
595 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_, 604 FROM_HERE, base::Bind(async_call_status_data_handler_, async_call_id_,
596 true, std::string())); 605 true, std::string()));
597 } 606 }
598 ++async_call_id_; 607 ++async_call_id_;
599 } 608 }
600 609
601 } // namespace chromeos 610 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698