| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return kCheckForUpgradeMs; | 90 return kCheckForUpgradeMs; |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Return true if the current build is one of the unstable channels. | 93 // Return true if the current build is one of the unstable channels. |
| 94 bool IsUnstableChannel() { | 94 bool IsUnstableChannel() { |
| 95 // TODO(mad): Investigate whether we still need to be on the file thread for | 95 // TODO(mad): Investigate whether we still need to be on the file thread for |
| 96 // this. On Windows, the file thread used to be required for registry access | 96 // this. On Windows, the file thread used to be required for registry access |
| 97 // but no anymore. But other platform may still need the file thread. | 97 // but no anymore. But other platform may still need the file thread. |
| 98 // crbug.com/366647. | 98 // crbug.com/366647. |
| 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 99 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 100 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | 100 version_info::Channel channel = chrome::VersionInfo::GetChannel(); |
| 101 return channel == chrome::VersionInfo::CHANNEL_DEV || | 101 return channel == version_info::CHANNEL_DEV || |
| 102 channel == chrome::VersionInfo::CHANNEL_CANARY; | 102 channel == version_info::CHANNEL_CANARY; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // This task identifies whether we are running an unstable version. And then it | 105 // This task identifies whether we are running an unstable version. And then it |
| 106 // unconditionally calls back the provided task. | 106 // unconditionally calls back the provided task. |
| 107 void CheckForUnstableChannel(const base::Closure& callback_task, | 107 void CheckForUnstableChannel(const base::Closure& callback_task, |
| 108 bool* is_unstable_channel) { | 108 bool* is_unstable_channel) { |
| 109 *is_unstable_channel = IsUnstableChannel(); | 109 *is_unstable_channel = IsUnstableChannel(); |
| 110 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_task); | 110 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_task); |
| 111 } | 111 } |
| 112 | 112 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 507 |
| 508 // static | 508 // static |
| 509 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 509 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
| 510 return Singleton<UpgradeDetectorImpl>::get(); | 510 return Singleton<UpgradeDetectorImpl>::get(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 // static | 513 // static |
| 514 UpgradeDetector* UpgradeDetector::GetInstance() { | 514 UpgradeDetector* UpgradeDetector::GetInstance() { |
| 515 return UpgradeDetectorImpl::GetInstance(); | 515 return UpgradeDetectorImpl::GetInstance(); |
| 516 } | 516 } |
| OLD | NEW |