| OLD | NEW |
| 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/common/chrome_version_info.h" | 5 #include "chrome/common/channel_info.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "components/version_info/version_info.h" |
| 9 | 10 |
| 10 namespace chrome { | 11 namespace chrome { |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 | 14 |
| 14 // Helper function to return both the channel enum and modifier string. | 15 // Helper function to return both the channel enum and modifier string. |
| 15 // Implements both together to prevent their behavior from diverging, which has | 16 // Implements both together to prevent their behavior from diverging, which has |
| 16 // happened multiple times in the past. | 17 // happened multiple times in the past. |
| 17 version_info::Channel GetChannelImpl(std::string* modifier_out) { | 18 version_info::Channel GetChannelImpl(std::string* modifier_out) { |
| 18 version_info::Channel channel = version_info::Channel::UNKNOWN; | 19 version_info::Channel channel = version_info::Channel::UNKNOWN; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 #endif | 40 #endif |
| 40 | 41 |
| 41 if (modifier_out) | 42 if (modifier_out) |
| 42 modifier_out->swap(modifier); | 43 modifier_out->swap(modifier); |
| 43 | 44 |
| 44 return channel; | 45 return channel; |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace | 48 } // namespace |
| 48 | 49 |
| 49 // static | 50 std::string GetChannelString() { |
| 50 std::string VersionInfo::GetVersionStringModifier() { | |
| 51 std::string modifier; | 51 std::string modifier; |
| 52 GetChannelImpl(&modifier); | 52 GetChannelImpl(&modifier); |
| 53 return modifier; | 53 return modifier; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // static | 56 version_info::Channel GetChannel() { |
| 57 version_info::Channel VersionInfo::GetChannel() { | 57 return GetChannelImpl(nullptr); |
| 58 return GetChannelImpl(NULL); | |
| 59 } | 58 } |
| 60 | 59 |
| 61 } // namespace chrome | 60 } // namespace chrome |
| OLD | NEW |