blob: 714bd7b2f6c0f9740dd11fd6cf1546deff5d28c9 [file] [log] [blame]
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VERSION_INFO_CHANNEL_H_
#define COMPONENTS_VERSION_INFO_CHANNEL_H_
#include <string_view>
#include "base/notreached.h"
namespace version_info {
// The possible channels for an installation, from most fun to most stable.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.version_info
enum class Channel {
UNKNOWN = 0,
// DEFAULT is an alias for UNKNOWN because the build files use DEFAULT but the
// code uses UNKNOWN. TODO(paulmiller): Combine DEFAULT & UNKNOWN.
DEFAULT = UNKNOWN,
CANARY = 1,
DEV = 2,
BETA = 3,
STABLE = 4,
};
// Returns a string equivalent of |channel|, independent of whether the build
// is branded or not and without any additional modifiers.
constexpr std::string_view GetChannelString(Channel channel) {
switch (channel) {
case Channel::STABLE:
return "stable";
case Channel::BETA:
return "beta";
case Channel::DEV:
return "dev";
case Channel::CANARY:
return "canary";
case Channel::UNKNOWN:
return "unknown";
}
NOTREACHED_NORETURN();
}
} // namespace version_info
#endif // COMPONENTS_VERSION_INFO_CHANNEL_H_