| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/upgrade_detector_impl.h" | 5 #include "chrome/browser/upgrade_detector_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_HIGH); | 487 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_HIGH); |
| 488 } else if (time_passed >= elevated_threshold) { | 488 } else if (time_passed >= elevated_threshold) { |
| 489 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_ELEVATED); | 489 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_ELEVATED); |
| 490 } else if (time_passed >= low_threshold) { | 490 } else if (time_passed >= low_threshold) { |
| 491 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_LOW); | 491 set_upgrade_notification_stage(UPGRADE_ANNOYANCE_LOW); |
| 492 } else { | 492 } else { |
| 493 return; // Not ready to recommend upgrade. | 493 return; // Not ready to recommend upgrade. |
| 494 } | 494 } |
| 495 } | 495 } |
| 496 | 496 |
| 497 NotifyUpgradeRecommended(); | 497 NotifyUpgrade(); |
| 498 } | 498 } |
| 499 | 499 |
| 500 void UpgradeDetectorImpl::NotifyOnUpgrade() { | 500 void UpgradeDetectorImpl::NotifyOnUpgrade() { |
| 501 const base::TimeDelta time_passed = | 501 const base::TimeDelta time_passed = |
| 502 base::TimeTicks::Now() - upgrade_detected_time_; | 502 base::TimeTicks::Now() - upgrade_detected_time_; |
| 503 NotifyOnUpgradeWithTimePassed(time_passed); | 503 NotifyOnUpgradeWithTimePassed(time_passed); |
| 504 } | 504 } |
| 505 | 505 |
| 506 // static | 506 // static |
| 507 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 507 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
| 508 return base::Singleton<UpgradeDetectorImpl>::get(); | 508 return base::Singleton<UpgradeDetectorImpl>::get(); |
| 509 } | 509 } |
| 510 | 510 |
| 511 // static | 511 // static |
| 512 UpgradeDetector* UpgradeDetector::GetInstance() { | 512 UpgradeDetector* UpgradeDetector::GetInstance() { |
| 513 return UpgradeDetectorImpl::GetInstance(); | 513 return UpgradeDetectorImpl::GetInstance(); |
| 514 } | 514 } |
| OLD | NEW |