OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/extensions/features/feature_channel.h" | 5 #include "chrome/common/extensions/features/feature_channel.h" |
6 | 6 |
7 using chrome::VersionInfo; | 7 using chrome::VersionInfo; |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
11 const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE; | 11 const version_info::Channel kDefaultChannel = version_info::Channel::STABLE; |
12 VersionInfo::Channel g_current_channel = kDefaultChannel; | 12 version_info::Channel g_current_channel = kDefaultChannel; |
13 | 13 |
14 } // namespace | 14 } // namespace |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 VersionInfo::Channel GetCurrentChannel() { | 18 version_info::Channel GetCurrentChannel() { |
19 return g_current_channel; | 19 return g_current_channel; |
20 } | 20 } |
21 | 21 |
22 void SetCurrentChannel(VersionInfo::Channel channel) { | 22 void SetCurrentChannel(version_info::Channel channel) { |
23 g_current_channel = channel; | 23 g_current_channel = channel; |
24 } | 24 } |
25 | 25 |
26 VersionInfo::Channel GetDefaultChannel() { | 26 version_info::Channel GetDefaultChannel() { |
27 return kDefaultChannel; | 27 return kDefaultChannel; |
28 } | 28 } |
29 | 29 |
30 ScopedCurrentChannel::ScopedCurrentChannel(VersionInfo::Channel channel) | 30 ScopedCurrentChannel::ScopedCurrentChannel(version_info::Channel channel) |
31 : original_channel_(VersionInfo::CHANNEL_UNKNOWN) { | 31 : original_channel_(version_info::Channel::UNKNOWN) { |
32 original_channel_ = GetCurrentChannel(); | 32 original_channel_ = GetCurrentChannel(); |
33 SetCurrentChannel(channel); | 33 SetCurrentChannel(channel); |
34 } | 34 } |
35 | 35 |
36 ScopedCurrentChannel::~ScopedCurrentChannel() { | 36 ScopedCurrentChannel::~ScopedCurrentChannel() { |
37 SetCurrentChannel(original_channel_); | 37 SetCurrentChannel(original_channel_); |
38 } | 38 } |
39 | 39 |
40 } // namespace extensions | 40 } // namespace extensions |
OLD | NEW |