Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / common / chrome_version_info_android.cc
blobcfca3da14a8a82070853d6e5bd4845de5bf8f3ed
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
3 // found in the LICENSE file.
5 #include "chrome/common/chrome_version_info.h"
7 #include "base/android/build_info.h"
8 #include "base/logging.h"
9 #include "base/strings/string_util.h"
11 namespace chrome {
13 // static
14 std::string VersionInfo::GetVersionStringModifier() {
15 switch (GetChannel()) {
16 case CHANNEL_UNKNOWN: return "unknown";
17 case CHANNEL_CANARY: return "canary";
18 case CHANNEL_DEV: return "dev";
19 case CHANNEL_BETA: return "beta";
20 case CHANNEL_STABLE: return std::string();
22 NOTREACHED() << "Unknown channel " << GetChannel();
23 return std::string();
26 // static
27 VersionInfo::Channel VersionInfo::GetChannel() {
28 const base::android::BuildInfo* bi = base::android::BuildInfo::GetInstance();
29 DCHECK(bi && bi->package_name());
31 if (!strcmp(bi->package_name(), "com.android.chrome")
32 || !strcmp(bi->package_name(), "com.chrome.work"))
33 return CHANNEL_STABLE;
34 if (!strcmp(bi->package_name(), "com.chrome.beta"))
35 return CHANNEL_BETA;
36 if (!strcmp(bi->package_name(), "com.chrome.dev"))
37 return CHANNEL_DEV;
38 if (!strcmp(bi->package_name(), "com.chrome.canary"))
39 return CHANNEL_CANARY;
41 return CHANNEL_UNKNOWN;
44 } // namespace chrome