| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "chrome/browser/upgrade_detector.h" | 11 #include "chrome/browser/upgrade_detector.h" |
| 12 #include "chromeos/dbus/update_engine_client.h" | 12 #include "chromeos/dbus/update_engine_client.h" |
| 13 | 13 |
| 14 template <typename T> struct DefaultSingletonTraits; | 14 namespace base { |
| 15 template <typename T> |
| 16 struct DefaultSingletonTraits; |
| 17 } // namespace base |
| 15 | 18 |
| 16 class UpgradeDetectorChromeos : public UpgradeDetector, | 19 class UpgradeDetectorChromeos : public UpgradeDetector, |
| 17 public chromeos::UpdateEngineClient::Observer { | 20 public chromeos::UpdateEngineClient::Observer { |
| 18 public: | 21 public: |
| 19 ~UpgradeDetectorChromeos() override; | 22 ~UpgradeDetectorChromeos() override; |
| 20 | 23 |
| 21 static UpgradeDetectorChromeos* GetInstance(); | 24 static UpgradeDetectorChromeos* GetInstance(); |
| 22 | 25 |
| 23 // Initializes the object. Starts observing changes from the update | 26 // Initializes the object. Starts observing changes from the update |
| 24 // engine. | 27 // engine. |
| 25 void Init(); | 28 void Init(); |
| 26 | 29 |
| 27 // Shuts down the object. Stops observing observe changes from the | 30 // Shuts down the object. Stops observing observe changes from the |
| 28 // update engine. | 31 // update engine. |
| 29 void Shutdown(); | 32 void Shutdown(); |
| 30 | 33 |
| 31 private: | 34 private: |
| 32 friend struct DefaultSingletonTraits<UpgradeDetectorChromeos>; | 35 friend struct base::DefaultSingletonTraits<UpgradeDetectorChromeos>; |
| 33 class ChannelsRequester; | 36 class ChannelsRequester; |
| 34 | 37 |
| 35 UpgradeDetectorChromeos(); | 38 UpgradeDetectorChromeos(); |
| 36 | 39 |
| 37 // chromeos::UpdateEngineClient::Observer implementation. | 40 // chromeos::UpdateEngineClient::Observer implementation. |
| 38 void UpdateStatusChanged( | 41 void UpdateStatusChanged( |
| 39 const chromeos::UpdateEngineClient::Status& status) override; | 42 const chromeos::UpdateEngineClient::Status& status) override; |
| 40 | 43 |
| 41 // The function that sends out a notification (after a certain time has | 44 // The function that sends out a notification (after a certain time has |
| 42 // elapsed) that lets the rest of the UI know we should start notifying the | 45 // elapsed) that lets the rest of the UI know we should start notifying the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 base::Time upgrade_detected_time_; | 56 base::Time upgrade_detected_time_; |
| 54 | 57 |
| 55 scoped_ptr<ChannelsRequester> channels_requester_; | 58 scoped_ptr<ChannelsRequester> channels_requester_; |
| 56 | 59 |
| 57 base::WeakPtrFactory<UpgradeDetectorChromeos> weak_factory_; | 60 base::WeakPtrFactory<UpgradeDetectorChromeos> weak_factory_; |
| 58 | 61 |
| 59 DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorChromeos); | 62 DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorChromeos); |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ | 65 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_ |
| OLD | NEW |