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

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

Issue 7249003: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info_* (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: correct nits Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/singleton.h" 11 #include "base/memory/singleton.h"
12 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/task.h" 14 #include "base/task.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
17 #include "chrome/browser/platform_util.h"
18 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
19 #include "chrome/common/chrome_version_info.h" 18 #include "chrome/common/chrome_version_info.h"
20 #include "chrome/installer/util/browser_distribution.h" 19 #include "chrome/installer/util/browser_distribution.h"
21 #include "content/browser/browser_thread.h" 20 #include "content/browser/browser_thread.h"
22 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
23 22
24 #if defined(OS_WIN) 23 #if defined(OS_WIN)
25 #include "chrome/installer/util/install_util.h" 24 #include "chrome/installer/util/install_util.h"
26 #elif defined(OS_MACOSX) 25 #elif defined(OS_MACOSX)
27 #include "chrome/browser/mac/keystone_glue.h" 26 #include "chrome/browser/mac/keystone_glue.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 command_line.AppendSwitch(switches::kProductVersion); 104 command_line.AppendSwitch(switches::kProductVersion);
106 std::string reply; 105 std::string reply;
107 if (!base::GetAppOutput(command_line, &reply)) { 106 if (!base::GetAppOutput(command_line, &reply)) {
108 DLOG(ERROR) << "Failed to get current file version"; 107 DLOG(ERROR) << "Failed to get current file version";
109 return; 108 return;
110 } 109 }
111 110
112 installed_version.reset(Version::GetVersionFromString(reply)); 111 installed_version.reset(Version::GetVersionFromString(reply));
113 #endif 112 #endif
114 113
115 platform_util::Channel channel = platform_util::GetChannel(); 114 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
116 *is_unstable_channel_ = channel == platform_util::CHANNEL_DEV || 115 *is_unstable_channel_ = channel == chrome::VersionInfo::CHANNEL_DEV ||
117 channel == platform_util::CHANNEL_CANARY; 116 channel == chrome::VersionInfo::CHANNEL_CANARY;
118 117
119 // Get the version of the currently *running* instance of Chrome. 118 // Get the version of the currently *running* instance of Chrome.
120 chrome::VersionInfo version_info; 119 chrome::VersionInfo version_info;
121 if (!version_info.is_valid()) { 120 if (!version_info.is_valid()) {
122 NOTREACHED() << "Failed to get current file version"; 121 NOTREACHED() << "Failed to get current file version";
123 return; 122 return;
124 } 123 }
125 scoped_ptr<Version> running_version( 124 scoped_ptr<Version> running_version(
126 Version::GetVersionFromString(version_info.Version())); 125 Version::GetVersionFromString(version_info.Version()));
127 if (running_version.get() == NULL) { 126 if (running_version.get() == NULL) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 255
257 // static 256 // static
258 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() { 257 UpgradeDetectorImpl* UpgradeDetectorImpl::GetInstance() {
259 return Singleton<UpgradeDetectorImpl>::get(); 258 return Singleton<UpgradeDetectorImpl>::get();
260 } 259 }
261 260
262 // static 261 // static
263 UpgradeDetector* UpgradeDetector::GetInstance() { 262 UpgradeDetector* UpgradeDetector::GetInstance() {
264 return UpgradeDetectorImpl::GetInstance(); 263 return UpgradeDetectorImpl::GetInstance();
265 } 264 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/about_page_handler.cc ('k') | chrome/browser/web_resource/promo_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698