Chromium Code Reviews| 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 "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "base/time/time.h" | |
| 13 | |
| 14 namespace message_center { | |
| 15 class Notification; | |
| 16 class MessageCenter; | |
| 17 } | |
| 18 | |
| 19 namespace chromeos { | |
| 20 | |
| 21 class LowDiskNotification { | |
|
satorux1
2016/06/27 07:46:39
class comment is missing.
https://google.github.i
dspaid1
2016/06/28 00:39:06
Done.
| |
| 22 public: | |
| 23 LowDiskNotification(); | |
| 24 ~LowDiskNotification(); | |
| 25 | |
| 26 // Called when the device is running low on disk space. This is responsible | |
| 27 // for deciding whether a notification should be shown or not and showing it | |
| 28 // if appropriate. | |
| 29 void OnLowDiskSpace(uint64_t free_disk_bytes); | |
| 30 | |
| 31 private: | |
| 32 friend class LowDiskNotificationTest; | |
| 33 | |
| 34 enum Severity { NONE = -1, MEDIUM = 0, HIGH = 1 }; | |
| 35 | |
| 36 std::unique_ptr<message_center::Notification> CreateNotification( | |
| 37 Severity severity); | |
| 38 Severity GetSeverity(uint64_t free_disk_bytes); | |
| 39 void SetMessageCenterForTest(message_center::MessageCenter* message_center); | |
| 40 void SetNotificationIntervalForTest(base::TimeDelta interval); | |
|
satorux1
2016/06/27 07:46:40
function comments are missing.
https://google.git
dspaid1
2016/06/28 00:39:06
Done.
| |
| 41 | |
| 42 base::Time last_notification_time_; | |
| 43 Severity last_notification_severity_; | |
| 44 message_center::MessageCenter* message_center_; | |
| 45 base::TimeDelta notification_interval_; | |
| 46 base::WeakPtrFactory<LowDiskNotification> weak_ptr_factory_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(LowDiskNotification); | |
| 49 }; | |
| 50 | |
| 51 } // namespace chromeos | |
| 52 | |
| 53 #endif // CHROME_BROWSER_CHROMEOS_UI_LOW_DISK_NOTIFICATION_H_ | |
| OLD | NEW |