| 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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 | 403 |
| 404 #if defined(OS_WIN) | 404 #if defined(OS_WIN) |
| 405 // Don't show the update bubbles to enterprise users (i.e., on a domain). | 405 // Don't show the update bubbles to enterprise users (i.e., on a domain). |
| 406 if (base::win::IsEnrolledToDomain()) | 406 if (base::win::IsEnrolledToDomain()) |
| 407 return false; | 407 return false; |
| 408 #endif | 408 #endif |
| 409 } | 409 } |
| 410 | 410 |
| 411 base::Time network_time; | 411 base::Time network_time; |
| 412 base::TimeDelta uncertainty; | 412 base::TimeDelta uncertainty; |
| 413 if (!g_browser_process->network_time_tracker()->GetNetworkTime( | 413 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time, |
| 414 &network_time, &uncertainty)) { | 414 &uncertainty) != |
| 415 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) { |
| 415 // When network time has not been initialized yet, simply rely on the | 416 // When network time has not been initialized yet, simply rely on the |
| 416 // machine's current time. | 417 // machine's current time. |
| 417 network_time = base::Time::Now(); | 418 network_time = base::Time::Now(); |
| 418 } | 419 } |
| 419 | 420 |
| 420 if (network_time.is_null() || build_date_.is_null() || | 421 if (network_time.is_null() || build_date_.is_null() || |
| 421 build_date_ > network_time) { | 422 build_date_ > network_time) { |
| 422 NOTREACHED(); | 423 NOTREACHED(); |
| 423 return false; | 424 return false; |
| 424 } | 425 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 | 515 |
| 515 // static | 516 // static |
| 516 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 517 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
| 517 return base::Singleton<UpgradeDetectorImpl>::get(); | 518 return base::Singleton<UpgradeDetectorImpl>::get(); |
| 518 } | 519 } |
| 519 | 520 |
| 520 // static | 521 // static |
| 521 UpgradeDetector* UpgradeDetector::GetInstance() { | 522 UpgradeDetector* UpgradeDetector::GetInstance() { |
| 522 return UpgradeDetectorImpl::GetInstance(); | 523 return UpgradeDetectorImpl::GetInstance(); |
| 523 } | 524 } |
| OLD | NEW |