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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_
6 #define CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_
9 #include "base/compiler_specific.h"
10 #include "base/timer.h"
11 #include "chrome/browser/chromeos/dbus/update_engine_client.h"
12 #include "chrome/browser/upgrade_detector.h"
14 template <typename T
> struct DefaultSingletonTraits
;
16 class UpgradeDetectorChromeos
: public UpgradeDetector
,
17 public chromeos::UpdateEngineClient::Observer
{
19 virtual ~UpgradeDetectorChromeos();
21 static UpgradeDetectorChromeos
* GetInstance();
23 // Initializes the object. Starts observing changes from the update
27 // Shuts down the object. Stops observing observe changes from the
32 friend struct DefaultSingletonTraits
<UpgradeDetectorChromeos
>;
34 UpgradeDetectorChromeos();
36 // chromeos::UpdateEngineClient::Observer implementation.
37 virtual void UpdateStatusChanged(
38 const chromeos::UpdateEngineClient::Status
& status
) OVERRIDE
;
40 // The function that sends out a notification (after a certain time has
41 // elapsed) that lets the rest of the UI know we should start notifying the
42 // user that a new version is available.
43 void NotifyOnUpgrade();
45 // After we detect an upgrade we start a recurring timer to see if enough time
46 // has passed and we should start notifying the user.
47 base::RepeatingTimer
<UpgradeDetectorChromeos
> upgrade_notification_timer_
;
51 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_