| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 void UpgradeDetectorImpl::DetectUpgradeTask( | 308 void UpgradeDetectorImpl::DetectUpgradeTask( |
| 309 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) { | 309 base::WeakPtr<UpgradeDetectorImpl> upgrade_detector) { |
| 310 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 310 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 311 | 311 |
| 312 Version critical_update; | 312 Version critical_update; |
| 313 Version installed_version = | 313 Version installed_version = |
| 314 GetCurrentlyInstalledVersionImpl(&critical_update); | 314 GetCurrentlyInstalledVersionImpl(&critical_update); |
| 315 | 315 |
| 316 // Get the version of the currently *running* instance of Chrome. | 316 // Get the version of the currently *running* instance of Chrome. |
| 317 chrome::VersionInfo version_info; | 317 chrome::VersionInfo version_info; |
| 318 if (!version_info.is_valid()) { | |
| 319 NOTREACHED() << "Failed to get current file version"; | |
| 320 return; | |
| 321 } | |
| 322 Version running_version(version_info.Version()); | 318 Version running_version(version_info.Version()); |
| 323 if (!running_version.IsValid()) { | 319 if (!running_version.IsValid()) { |
| 324 NOTREACHED(); | 320 NOTREACHED(); |
| 325 return; | 321 return; |
| 326 } | 322 } |
| 327 | 323 |
| 328 // |installed_version| may be NULL when the user downgrades on Linux (by | 324 // |installed_version| may be NULL when the user downgrades on Linux (by |
| 329 // switching from dev to beta channel, for example). The user needs a | 325 // switching from dev to beta channel, for example). The user needs a |
| 330 // restart in this case as well. See http://crbug.com/46547 | 326 // restart in this case as well. See http://crbug.com/46547 |
| 331 if (!installed_version.IsValid() || | 327 if (!installed_version.IsValid() || |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 508 |
| 513 // static | 509 // static |
| 514 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 510 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
| 515 return Singleton<UpgradeDetectorImpl>::get(); | 511 return Singleton<UpgradeDetectorImpl>::get(); |
| 516 } | 512 } |
| 517 | 513 |
| 518 // static | 514 // static |
| 519 UpgradeDetector* UpgradeDetector::GetInstance() { | 515 UpgradeDetector* UpgradeDetector::GetInstance() { |
| 520 return UpgradeDetectorImpl::GetInstance(); | 516 return UpgradeDetectorImpl::GetInstance(); |
| 521 } | 517 } |
| OLD | NEW |