Return backed up TemplateURL on default search change
[chromium-blink-merge.git] / chrome / browser / chromeos / upgrade_detector_chromeos.h
blob7e80537bef5a49c63c33ff946b6a8f691fe681e3
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_
7 #pragma once
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 {
18 public:
19 virtual ~UpgradeDetectorChromeos();
21 static UpgradeDetectorChromeos* GetInstance();
23 // Initializes the object. Starts observing changes from the update
24 // engine.
25 void Init();
27 // Shuts down the object. Stops observing observe changes from the
28 // update engine.
29 void Shutdown();
31 private:
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_;
48 bool initialized_;
51 #endif // CHROME_BROWSER_CHROMEOS_UPGRADE_DETECTOR_CHROMEOS_H_