Commit 9877c4bd authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Move version_info::GetChannel() into version_info::android namespace.

Because it is actually an Android-only function. Update the caller in
chrome/common and fix a random nit there.

Change-Id: I4b488987cf4bb245c1665abefc24285aa6192b2a
Reviewed-on: https://chromium-review.googlesource.com/c/1338886Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608815}
parent 57cf470c
...@@ -240,7 +240,7 @@ bool AwMetricsServiceClient::GetBrand(std::string* brand_code) { ...@@ -240,7 +240,7 @@ bool AwMetricsServiceClient::GetBrand(std::string* brand_code) {
} }
metrics::SystemProfileProto::Channel AwMetricsServiceClient::GetChannel() { metrics::SystemProfileProto::Channel AwMetricsServiceClient::GetChannel() {
return metrics::AsProtobufChannel(version_info::GetChannel()); return metrics::AsProtobufChannel(version_info::android::GetChannel());
} }
std::string AwMetricsServiceClient::GetVersionString() { std::string AwMetricsServiceClient::GetVersionString() {
......
...@@ -11,7 +11,7 @@ namespace android_webview { ...@@ -11,7 +11,7 @@ namespace android_webview {
using version_info::Channel; using version_info::Channel;
Channel GetChannelOrStable() { Channel GetChannelOrStable() {
Channel channel = version_info::GetChannel(); Channel channel = version_info::android::GetChannel();
return channel == Channel::UNKNOWN ? Channel::STABLE : channel; return channel == Channel::UNKNOWN ? Channel::STABLE : channel;
} }
......
...@@ -25,7 +25,7 @@ std::string GetChannelName() { ...@@ -25,7 +25,7 @@ std::string GetChannelName() {
} }
version_info::Channel GetChannel() { version_info::Channel GetChannel() {
return version_info::GetChannel(); return version_info::android::GetChannel();
} }
} // namespace chrome } // namespace chrome
...@@ -43,18 +43,15 @@ std::string GetChannelName() { ...@@ -43,18 +43,15 @@ std::string GetChannelName() {
version_info::Channel GetChannelByName(const std::string& channel) { version_info::Channel GetChannelByName(const std::string& channel) {
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
if (channel.empty())
if (channel.empty()) {
return version_info::Channel::STABLE; return version_info::Channel::STABLE;
} else if (channel == "beta") { if (channel == "beta")
return version_info::Channel::BETA; return version_info::Channel::BETA;
} else if (channel == "dev") { if (channel == "dev")
return version_info::Channel::DEV; return version_info::Channel::DEV;
} else if (channel == "canary") { if (channel == "canary")
return version_info::Channel::CANARY; return version_info::Channel::CANARY;
}
#endif #endif
return version_info::Channel::UNKNOWN; return version_info::Channel::UNKNOWN;
} }
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
#include "jni/VersionConstantsBridge_jni.h" #include "jni/VersionConstantsBridge_jni.h"
namespace version_info { namespace version_info {
namespace android {
Channel GetChannel() { Channel GetChannel() {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
return static_cast<Channel>(Java_VersionConstantsBridge_getChannel(env)); return static_cast<Channel>(Java_VersionConstantsBridge_getChannel(env));
} }
} // namespace android
} // namespace version_info } // namespace version_info
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
#include "components/version_info/channel.h" #include "components/version_info/channel.h"
namespace version_info { namespace version_info {
namespace android {
Channel GetChannel(); Channel GetChannel();
} } // namespace android
} // namespace version_info
#endif // COMPONENTS_VERSION_INFO_ANDROID_CHANNEL_GETTER_H_ #endif // COMPONENTS_VERSION_INFO_ANDROID_CHANNEL_GETTER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment