| 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/common/chrome_version_info.h" | 5 #include "chrome/common/chrome_version_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 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 } | 21 } |
| 22 NOTREACHED() << "Unknown channel " << GetChannel(); | 22 NOTREACHED() << "Unknown channel " << GetChannel(); |
| 23 return std::string(); | 23 return std::string(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 // static | 26 // static |
| 27 VersionInfo::Channel VersionInfo::GetChannel() { | 27 VersionInfo::Channel VersionInfo::GetChannel() { |
| 28 const base::android::BuildInfo* bi = base::android::BuildInfo::GetInstance(); | 28 const base::android::BuildInfo* bi = base::android::BuildInfo::GetInstance(); |
| 29 DCHECK(bi && bi->package_name()); | 29 DCHECK(bi && bi->package_name()); |
| 30 | 30 |
| 31 if (!strcmp(bi->package_name(), "com.android.chrome")) | 31 if (!strcmp(bi->package_name(), "com.android.chrome") |
| 32 || !strcmp(bi->package_name(), "com.chrome.work")) |
| 32 return CHANNEL_STABLE; | 33 return CHANNEL_STABLE; |
| 33 if (!strcmp(bi->package_name(), "com.chrome.beta")) | 34 if (!strcmp(bi->package_name(), "com.chrome.beta")) |
| 34 return CHANNEL_BETA; | 35 return CHANNEL_BETA; |
| 35 if (!strcmp(bi->package_name(), "com.google.android.apps.chrome_dev")) | 36 if (!strcmp(bi->package_name(), "com.google.android.apps.chrome_dev")) |
| 36 return CHANNEL_DEV; | 37 return CHANNEL_DEV; |
| 37 if (!strcmp(bi->package_name(), "com.chrome.canary")) | 38 if (!strcmp(bi->package_name(), "com.chrome.canary")) |
| 38 return CHANNEL_CANARY; | 39 return CHANNEL_CANARY; |
| 39 | 40 |
| 40 return CHANNEL_UNKNOWN; | 41 return CHANNEL_UNKNOWN; |
| 41 } | 42 } |
| 42 | 43 |
| 43 } // namespace chrome | 44 } // namespace chrome |
| OLD | NEW |