Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Side by Side Diff: chrome/browser/upgrade_detector_impl.cc

Issue 1257633002: Componentize VersionInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix OWNERS (copy from //chrome/OWNERS) Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698