| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/timer.h" | 9 #include "base/timer.h" |
| 10 #include "chrome/browser/chromeos/cros/update_library.h" | 10 #include "chrome/browser/chromeos/cros/update_library.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void SetRebootCheckDelay(int seconds); | 53 void SetRebootCheckDelay(int seconds); |
| 54 | 54 |
| 55 // Returns true if there is critical system update that requires installation | 55 // Returns true if there is critical system update that requires installation |
| 56 // and immediate reboot. | 56 // and immediate reboot. |
| 57 bool HasCriticalUpdate(); | 57 bool HasCriticalUpdate(); |
| 58 | 58 |
| 59 // Set flag to treat all updates as critical (for test purpose mainly). | 59 // Set flag to treat all updates as critical (for test purpose mainly). |
| 60 // Default value is false. | 60 // Default value is false. |
| 61 void SetAllUpdatesCritical(bool is_critical); | 61 void SetAllUpdatesCritical(bool is_critical); |
| 62 | 62 |
| 63 // Returns true if this instance is still active (i.e. has not been deleted). |
| 64 static bool HasInstance(UpdateScreen* inst); |
| 65 |
| 63 private: | 66 private: |
| 64 // Timer notification handlers. | 67 // Timer notification handlers. |
| 65 void OnWaitForRebootTimeElapsed(); | 68 void OnWaitForRebootTimeElapsed(); |
| 66 | 69 |
| 67 // Checks that screen is shown, shows if not. | 70 // Checks that screen is shown, shows if not. |
| 68 void MakeSureScreenIsShown(); | 71 void MakeSureScreenIsShown(); |
| 69 | 72 |
| 70 // Timer for the interval to wait for the reboot. | 73 // Timer for the interval to wait for the reboot. |
| 71 // If reboot didn't happen - ask user to reboot manually. | 74 // If reboot didn't happen - ask user to reboot manually. |
| 72 base::OneShotTimer<UpdateScreen> reboot_timer_; | 75 base::OneShotTimer<UpdateScreen> reboot_timer_; |
| 73 | 76 |
| 77 // Returns a static InstanceSet. |
| 78 typedef std::set<UpdateScreen*> InstanceSet; |
| 79 static InstanceSet& GetInstanceSet(); |
| 80 |
| 74 // True if in the process of checking for update. | 81 // True if in the process of checking for update. |
| 75 bool checking_for_update_; | 82 bool checking_for_update_; |
| 76 | 83 |
| 77 // Time in seconds after which we decide that the device has not rebooted | 84 // Time in seconds after which we decide that the device has not rebooted |
| 78 // automatically. If reboot didn't happen during this interval, ask user to | 85 // automatically. If reboot didn't happen during this interval, ask user to |
| 79 // reboot device manually. | 86 // reboot device manually. |
| 80 int reboot_check_delay_; | 87 int reboot_check_delay_; |
| 81 | 88 |
| 82 // Flag that is used to detect when update download has just started. | 89 // Flag that is used to detect when update download has just started. |
| 83 bool is_downloading_update_; | 90 bool is_downloading_update_; |
| 84 | 91 |
| 85 // Is all updates critical? If true, update deadlines are ignored. | 92 // Is all updates critical? If true, update deadlines are ignored. |
| 86 bool is_all_updates_critical_; | 93 bool is_all_updates_critical_; |
| 87 | 94 |
| 88 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); | 95 DISALLOW_COPY_AND_ASSIGN(UpdateScreen); |
| 89 }; | 96 }; |
| 90 | 97 |
| 91 } // namespace chromeos | 98 } // namespace chromeos |
| 92 | 99 |
| 93 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ | 100 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UPDATE_SCREEN_H_ |
| OLD | NEW |