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 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ |
6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ | 6 #define CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ |
7 | 7 |
8 #include "chrome/common/chrome_version_info.h" | 8 #include "base/macros.h" |
| 9 #include "components/version_info/version_info.h" |
9 | 10 |
10 namespace extensions { | 11 namespace extensions { |
11 | 12 |
12 // Gets the current channel as seen by the Feature system. | 13 // Gets the current channel as seen by the Feature system. |
13 version_info::Channel GetCurrentChannel(); | 14 version_info::Channel GetCurrentChannel(); |
14 | 15 |
15 // Sets the current channel as seen by the Feature system. In the browser | 16 // Sets the current channel as seen by the Feature system. In the browser |
16 // process this should be chrome::VersionInfo::GetChannel(), and in the | 17 // process this should be chrome::GetChannel(), and in the renderer this will |
17 // renderer this will need to come from an IPC. | 18 // need to come from an IPC. |
18 void SetCurrentChannel(version_info::Channel channel); | 19 void SetCurrentChannel(version_info::Channel channel); |
19 | 20 |
20 // Gets the default channel as seen by the Feature system. | 21 // Gets the default channel as seen by the Feature system. |
21 version_info::Channel GetDefaultChannel(); | 22 version_info::Channel GetDefaultChannel(); |
22 | 23 |
23 // Scoped channel setter. Use for tests. | 24 // Scoped channel setter. Use for tests. |
24 class ScopedCurrentChannel { | 25 class ScopedCurrentChannel { |
25 public: | 26 public: |
26 explicit ScopedCurrentChannel(version_info::Channel channel); | 27 explicit ScopedCurrentChannel(version_info::Channel channel); |
27 ~ScopedCurrentChannel(); | 28 ~ScopedCurrentChannel(); |
28 | 29 |
29 private: | 30 private: |
30 version_info::Channel original_channel_; | 31 version_info::Channel original_channel_; |
31 | 32 |
32 DISALLOW_COPY_AND_ASSIGN(ScopedCurrentChannel); | 33 DISALLOW_COPY_AND_ASSIGN(ScopedCurrentChannel); |
33 }; | 34 }; |
34 | 35 |
35 } // namespace extensions | 36 } // namespace extensions |
36 | 37 |
37 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ | 38 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ |
OLD | NEW |