OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UPGRADE_DETECTOR_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_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/dbus/update_engine_client.h" |
11 #include "chrome/browser/upgrade_detector.h" | 11 #include "chrome/browser/upgrade_detector.h" |
12 | 12 |
13 template <typename T> struct DefaultSingletonTraits; | 13 template <typename T> struct DefaultSingletonTraits; |
14 | 14 |
15 class UpgradeDetectorChromeos : public UpgradeDetector, | 15 class UpgradeDetectorChromeos : public UpgradeDetector, |
16 public chromeos::UpdateLibrary::Observer { | 16 public chromeos::UpdateEngineClient::Observer { |
17 public: | 17 public: |
18 virtual ~UpgradeDetectorChromeos(); | 18 virtual ~UpgradeDetectorChromeos(); |
19 | 19 |
20 static UpgradeDetectorChromeos* GetInstance(); | 20 static UpgradeDetectorChromeos* GetInstance(); |
21 | 21 |
22 // Initializes the object. Starts observing changes from the update | 22 // Initializes the object. Starts observing changes from the update |
23 // engine. | 23 // engine. |
24 void Init(); | 24 void Init(); |
25 | 25 |
26 // Shuts down the object. Stops observing observe changes from the | 26 // Shuts down the object. Stops observing observe changes from the |
27 // update engine. | 27 // update engine. |
28 void Shutdown(); | 28 void Shutdown(); |
29 | 29 |
30 private: | 30 private: |
31 friend struct DefaultSingletonTraits<UpgradeDetectorChromeos>; | 31 friend struct DefaultSingletonTraits<UpgradeDetectorChromeos>; |
32 | 32 |
33 UpgradeDetectorChromeos(); | 33 UpgradeDetectorChromeos(); |
34 | 34 |
35 // chromeos::UpdateLibrary::Observer implementation. | 35 // chromeos::UpdateEngineClient::Observer implementation. |
36 virtual void UpdateStatusChanged( | 36 virtual void UpdateStatusChanged( |
37 const chromeos::UpdateLibrary::Status& status); | 37 const chromeos::UpdateEngineClient::Status& status) OVERRIDE; |
38 | 38 |
39 // The function that sends out a notification (after a certain time has | 39 // The function that sends out a notification (after a certain time has |
40 // elapsed) that lets the rest of the UI know we should start notifying the | 40 // elapsed) that lets the rest of the UI know we should start notifying the |
41 // user that a new version is available. | 41 // user that a new version is available. |
42 void NotifyOnUpgrade(); | 42 void NotifyOnUpgrade(); |
43 | 43 |
44 // After we detect an upgrade we start a recurring timer to see if enough time | 44 // After we detect an upgrade we start a recurring timer to see if enough time |
45 // has passed and we should start notifying the user. | 45 // has passed and we should start notifying the user. |
46 base::RepeatingTimer<UpgradeDetectorChromeos> upgrade_notification_timer_; | 46 base::RepeatingTimer<UpgradeDetectorChromeos> upgrade_notification_timer_; |
47 bool initialized_; | 47 bool initialized_; |
48 }; | 48 }; |
49 | 49 |
50 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ |
OLD | NEW |