| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 410 |
| 411 #if defined(OS_WIN) | 411 #if defined(OS_WIN) |
| 412 // Don't show the update bubbles to enterprise users (i.e., on a domain). | 412 // Don't show the update bubbles to enterprise users (i.e., on a domain). |
| 413 if (base::win::IsEnrolledToDomain()) | 413 if (base::win::IsEnrolledToDomain()) |
| 414 return false; | 414 return false; |
| 415 #endif | 415 #endif |
| 416 } | 416 } |
| 417 | 417 |
| 418 base::Time network_time; | 418 base::Time network_time; |
| 419 base::TimeDelta uncertainty; | 419 base::TimeDelta uncertainty; |
| 420 if (!g_browser_process->network_time_tracker()->GetNetworkTime( | 420 if (g_browser_process->network_time_tracker()->GetNetworkTime(&network_time, |
| 421 &network_time, &uncertainty)) { | 421 &uncertainty) != |
| 422 network_time::NetworkTimeTracker::NETWORK_TIME_AVAILABLE) { |
| 422 // When network time has not been initialized yet, simply rely on the | 423 // When network time has not been initialized yet, simply rely on the |
| 423 // machine's current time. | 424 // machine's current time. |
| 424 network_time = base::Time::Now(); | 425 network_time = base::Time::Now(); |
| 425 } | 426 } |
| 426 | 427 |
| 427 if (network_time.is_null() || build_date_.is_null() || | 428 if (network_time.is_null() || build_date_.is_null() || |
| 428 build_date_ > network_time) { | 429 build_date_ > network_time) { |
| 429 NOTREACHED(); | 430 NOTREACHED(); |
| 430 return false; | 431 return false; |
| 431 } | 432 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 522 |
| 522 // static | 523 // static |
| 523 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 524 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
| 524 return base::Singleton<UpgradeDetectorImpl>::get(); | 525 return base::Singleton<UpgradeDetectorImpl>::get(); |
| 525 } | 526 } |
| 526 | 527 |
| 527 // static | 528 // static |
| 528 UpgradeDetector* UpgradeDetector::GetInstance() { | 529 UpgradeDetector* UpgradeDetector::GetInstance() { |
| 529 return UpgradeDetectorImpl::GetInstance(); | 530 return UpgradeDetectorImpl::GetInstance(); |
| 530 } | 531 } |
| OLD | NEW |