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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_
6 #define CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_
8 #include "base/compiler_specific.h"
9 #include "base/timer.h"
10 #include "chrome/browser/upgrade_detector.h"
11 #include "chromeos/dbus/update_engine_client.h"
13 template <typename T
> struct DefaultSingletonTraits
;
15 class UpgradeDetectorChromeos
: public UpgradeDetector
,
16 public chromeos::UpdateEngineClient::Observer
{
18 virtual ~UpgradeDetectorChromeos();
20 static UpgradeDetectorChromeos
* GetInstance();
22 // Initializes the object. Starts observing changes from the update
26 // Shuts down the object. Stops observing observe changes from the
31 friend struct DefaultSingletonTraits
<UpgradeDetectorChromeos
>;
33 UpgradeDetectorChromeos();
35 // chromeos::UpdateEngineClient::Observer implementation.
36 virtual void UpdateStatusChanged(
37 const chromeos::UpdateEngineClient::Status
& status
) OVERRIDE
;
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
41 // user that a new version is available.
42 void NotifyOnUpgrade();
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.
46 base::RepeatingTimer
<UpgradeDetectorChromeos
> upgrade_notification_timer_
;
50 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_