Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: chrome/browser/upgrade_detector_impl.h

Issue 7046096: Refactor UpgradeDetector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and address finnur's comments in set 2 Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/upgrade_detector.cc ('k') | chrome/browser/upgrade_detector_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_
6 #define CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_
7 #pragma once
8
9 #include "base/timer.h"
10 #include "chrome/browser/upgrade_detector.h"
11
12 template <typename T> struct DefaultSingletonTraits;
13
14 class UpgradeDetectorImpl : public UpgradeDetector {
15 public:
16 virtual ~UpgradeDetectorImpl();
17
18 // Returns the singleton instance.
19 static UpgradeDetectorImpl* GetInstance();
20
21 private:
22 friend struct DefaultSingletonTraits<UpgradeDetectorImpl>;
23
24 UpgradeDetectorImpl();
25
26 // Launches a task on the file thread to check if we have the latest version.
27 void CheckForUpgrade();
28
29 // Sends out a notification and starts a one shot timer to wait until
30 // notifying the user.
31 void UpgradeDetected();
32
33 // The function that sends out a notification (after a certain time has
34 // elapsed) that lets the rest of the UI know we should start notifying the
35 // user that a new version is available.
36 void NotifyOnUpgrade();
37
38 // We periodically check to see if Chrome has been upgraded.
39 base::RepeatingTimer<UpgradeDetectorImpl> detect_upgrade_timer_;
40
41 // After we detect an upgrade we start a recurring timer to see if enough time
42 // has passed and we should start notifying the user.
43 base::RepeatingTimer<UpgradeDetectorImpl> upgrade_notification_timer_;
44
45 // We use this factory to create callback tasks for UpgradeDetected. We pass
46 // the task to the actual upgrade detection code, which is in
47 // DetectUpgradeTask.
48 ScopedRunnableMethodFactory<UpgradeDetectorImpl> method_factory_;
49
50 // True if this build is a dev or canary channel build.
51 bool is_unstable_channel_;
52
53 DISALLOW_COPY_AND_ASSIGN(UpgradeDetectorImpl);
54 };
55
56
57 #endif // CHROME_BROWSER_UPGRADE_DETECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/upgrade_detector.cc ('k') | chrome/browser/upgrade_detector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698