OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_UI_LOW_DISK_NOTIFICATION_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_UI_LOW_DISK_NOTIFICATION_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "base/macros.h" |
| 13 #include "base/time/time.h" |
| 14 |
| 15 namespace message_center { |
| 16 class Notification; |
| 17 } |
| 18 |
| 19 namespace chromeos { |
| 20 |
| 21 class CryptohomeClient; |
| 22 |
| 23 class LowDiskNotification { |
| 24 public: |
| 25 explicit LowDiskNotification(CryptohomeClient* cryptohome_client); |
| 26 ~LowDiskNotification(); |
| 27 |
| 28 void OnLowDiskSpace(uint64_t free_disk_bytes); |
| 29 |
| 30 private: |
| 31 enum Severity { NONE = -1, MEDIUM = 0, HIGH = 1 }; |
| 32 |
| 33 std::unique_ptr<message_center::Notification> CreateNotification( |
| 34 Severity severity); |
| 35 Severity GetSeverity(uint64_t free_disk_bytes); |
| 36 |
| 37 base::Time last_notification_time_; |
| 38 Severity last_notification_severity_; |
| 39 |
| 40 CryptohomeClient* cryptohome_client_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(LowDiskNotification); |
| 43 }; |
| 44 |
| 45 } // namespace chromeos |
| 46 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_UI_LOW_DISK_NOTIFICATION_H_ |
OLD | NEW |