1 // Copyright 2013 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/extensions/features/feature_channel.h"
7 using chrome::VersionInfo
;
11 const VersionInfo::Channel kDefaultChannel
= VersionInfo::CHANNEL_STABLE
;
12 VersionInfo::Channel g_current_channel
= kDefaultChannel
;
16 namespace extensions
{
18 VersionInfo::Channel
GetCurrentChannel() {
19 return g_current_channel
;
22 void SetCurrentChannel(VersionInfo::Channel channel
) {
23 g_current_channel
= channel
;
26 VersionInfo::Channel
GetDefaultChannel() {
27 return kDefaultChannel
;
30 ScopedCurrentChannel::ScopedCurrentChannel(VersionInfo::Channel channel
)
31 : original_channel_(VersionInfo::CHANNEL_UNKNOWN
) {
32 original_channel_
= GetCurrentChannel();
33 SetCurrentChannel(channel
);
36 ScopedCurrentChannel::~ScopedCurrentChannel() {
37 SetCurrentChannel(original_channel_
);
40 } // namespace extensions