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...) 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 #if !defined(OS_WIN) | 105 #if !defined(OS_WIN) |
106 // This task identifies whether we are running an unstable version. And then it | 106 // This task identifies whether we are running an unstable version. And then it |
107 // unconditionally calls back the provided task. | 107 // unconditionally calls back the provided task. |
108 void CheckForUnstableChannel(const base::Closure& callback_task, | 108 void CheckForUnstableChannel(const base::Closure& callback_task, |
109 bool* is_unstable_channel) { | 109 bool* is_unstable_channel) { |
110 *is_unstable_channel = IsUnstableChannel(); | 110 *is_unstable_channel = IsUnstableChannel(); |
111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_task); | 111 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, callback_task); |
112 } | 112 } |
(...skipping 396 matching lines...) Loading... |
509 | 509 |
510 // static | 510 // static |
511 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { | 511 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { |
512 return Singleton<UpgradeDetectorImpl>::get(); | 512 return Singleton<UpgradeDetectorImpl>::get(); |
513 } | 513 } |
514 | 514 |
515 // static | 515 // static |
516 UpgradeDetector* UpgradeDetector::GetInstance() { | 516 UpgradeDetector* UpgradeDetector::GetInstance() { |
517 return UpgradeDetectorImpl::GetInstance(); | 517 return UpgradeDetectorImpl::GetInstance(); |
518 } | 518 } |
OLD | NEW |