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

Side by Side Diff: chrome/common/channel_info_android.cc

Issue 1269773002: Cleanup VersionInfo after componentization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « chrome/common/channel_info.cc ('k') | chrome/common/channel_info_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/chrome_version_info.h" 5 #include "chrome/common/channel_info.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "components/version_info/version_info.h"
10 11
11 namespace chrome { 12 namespace chrome {
12 13
13 // static 14 std::string GetChannelString() {
14 std::string VersionInfo::GetVersionStringModifier() {
15 switch (GetChannel()) { 15 switch (GetChannel()) {
16 case version_info::Channel::UNKNOWN: return "unknown"; 16 case version_info::Channel::UNKNOWN: return "unknown";
17 case version_info::Channel::CANARY: return "canary"; 17 case version_info::Channel::CANARY: return "canary";
18 case version_info::Channel::DEV: return "dev"; 18 case version_info::Channel::DEV: return "dev";
19 case version_info::Channel::BETA: return "beta"; 19 case version_info::Channel::BETA: return "beta";
20 case version_info::Channel::STABLE: return std::string(); 20 case version_info::Channel::STABLE: return std::string();
21 } 21 }
22 NOTREACHED() << "Unknown channel " << static_cast<int>(GetChannel()); 22 NOTREACHED() << "Unknown channel " << static_cast<int>(GetChannel());
23 return std::string(); 23 return std::string();
24 } 24 }
25 25
26 // static 26 version_info::Channel GetChannel() {
27 version_info::Channel VersionInfo::GetChannel() {
28 const base::android::BuildInfo* bi = base::android::BuildInfo::GetInstance(); 27 const base::android::BuildInfo* bi = base::android::BuildInfo::GetInstance();
29 DCHECK(bi && bi->package_name()); 28 DCHECK(bi && bi->package_name());
30 29
31 if (!strcmp(bi->package_name(), "com.android.chrome") 30 if (!strcmp(bi->package_name(), "com.android.chrome") ||
32 || !strcmp(bi->package_name(), "com.chrome.work")) 31 !strcmp(bi->package_name(), "com.chrome.work"))
33 return version_info::Channel::STABLE; 32 return version_info::Channel::STABLE;
34 if (!strcmp(bi->package_name(), "com.chrome.beta")) 33 if (!strcmp(bi->package_name(), "com.chrome.beta"))
35 return version_info::Channel::BETA; 34 return version_info::Channel::BETA;
36 if (!strcmp(bi->package_name(), "com.chrome.dev")) 35 if (!strcmp(bi->package_name(), "com.chrome.dev"))
37 return version_info::Channel::DEV; 36 return version_info::Channel::DEV;
38 if (!strcmp(bi->package_name(), "com.chrome.canary")) 37 if (!strcmp(bi->package_name(), "com.chrome.canary"))
39 return version_info::Channel::CANARY; 38 return version_info::Channel::CANARY;
40 39
41 return version_info::Channel::UNKNOWN; 40 return version_info::Channel::UNKNOWN;
42 } 41 }
43 42
44 } // namespace chrome 43 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/channel_info.cc ('k') | chrome/common/channel_info_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698