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

Side by Side Diff: chrome/browser/chromeos/upgrade_detector_chromeos.cc

Issue 7812036: Update base/timer.h code to pass through Location from call sites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix build, consistency Created 9 years, 3 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" 5 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h"
6 6
7 #include "base/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "chrome/browser/chromeos/cros/cros_library.h" 8 #include "chrome/browser/chromeos/cros/cros_library.h"
9 9
10 namespace { 10 namespace {
(...skipping 17 matching lines...) Expand all
28 if (library->status().status != chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT) 28 if (library->status().status != chromeos::UPDATE_STATUS_UPDATED_NEED_REBOOT)
29 return; 29 return;
30 30
31 NotifyUpgradeDetected(); 31 NotifyUpgradeDetected();
32 32
33 // ChromeOS shows upgrade arrow once the upgrade becomes available. 33 // ChromeOS shows upgrade arrow once the upgrade becomes available.
34 NotifyOnUpgrade(); 34 NotifyOnUpgrade();
35 35
36 // Setup timer to to move along the upgrade advisory system. 36 // Setup timer to to move along the upgrade advisory system.
37 upgrade_notification_timer_.Start( 37 upgrade_notification_timer_.Start(
38 base::TimeDelta::FromMilliseconds(kNotifyCycleTimeMs), 38 FROM_HERE, base::TimeDelta::FromMilliseconds(kNotifyCycleTimeMs),
39 this, &UpgradeDetectorChromeos::NotifyOnUpgrade); 39 this, &UpgradeDetectorChromeos::NotifyOnUpgrade);
40 } 40 }
41 41
42 void UpgradeDetectorChromeos::NotifyOnUpgrade() { 42 void UpgradeDetectorChromeos::NotifyOnUpgrade() {
43 base::TimeDelta delta = base::Time::Now() - upgrade_detected_time(); 43 base::TimeDelta delta = base::Time::Now() - upgrade_detected_time();
44 int64 time_passed = delta.InDays(); 44 int64 time_passed = delta.InDays();
45 45
46 const int kSevereThreshold = 7; 46 const int kSevereThreshold = 7;
47 const int kHighThreshold = 4; 47 const int kHighThreshold = 4;
48 const int kElevatedThreshold = 2; 48 const int kElevatedThreshold = 2;
(...skipping 20 matching lines...) Expand all
69 69
70 // static 70 // static
71 UpgradeDetectorChromeos* UpgradeDetectorChromeos::GetInstance() { 71 UpgradeDetectorChromeos* UpgradeDetectorChromeos::GetInstance() {
72 return Singleton<UpgradeDetectorChromeos>::get(); 72 return Singleton<UpgradeDetectorChromeos>::get();
73 } 73 }
74 74
75 // static 75 // static
76 UpgradeDetector* UpgradeDetector::GetInstance() { 76 UpgradeDetector* UpgradeDetector::GetInstance() {
77 return UpgradeDetectorChromeos::GetInstance(); 77 return UpgradeDetectorChromeos::GetInstance();
78 } 78 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698