Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: chrome/common/extensions/features/feature_channel.h

Issue 661593005: Build a few more extensions files only when extensions are enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/extensions/features/feature_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/common/chrome_version_info.h"
9 9
10 namespace extensions { 10 namespace extensions {
11 11
12 // Gets the current channel as seen by the Feature system. 12 // Gets the current channel as seen by the Feature system.
13 chrome::VersionInfo::Channel GetCurrentChannel(); 13 chrome::VersionInfo::Channel GetCurrentChannel();
14 14
15 // Sets the current channel as seen by the Feature system. In the browser 15 // Sets the current channel as seen by the Feature system. In the browser
16 // process this should be chrome::VersionInfo::GetChannel(), and in the 16 // process this should be chrome::VersionInfo::GetChannel(), and in the
17 // renderer this will need to come from an IPC. 17 // renderer this will need to come from an IPC.
18 void SetCurrentChannel(chrome::VersionInfo::Channel channel); 18 void SetCurrentChannel(chrome::VersionInfo::Channel channel);
19 19
20 // Gets the default channel as seen by the Feature system. 20 // Gets the default channel as seen by the Feature system.
21 chrome::VersionInfo::Channel GetDefaultChannel(); 21 chrome::VersionInfo::Channel GetDefaultChannel();
22 22
23 // Scoped channel setter. Use for tests. 23 // Scoped channel setter. Use for tests.
24 class ScopedCurrentChannel { 24 class ScopedCurrentChannel {
25 public: 25 public:
26 explicit ScopedCurrentChannel(chrome::VersionInfo::Channel channel) 26 explicit ScopedCurrentChannel(chrome::VersionInfo::Channel channel);
27 : original_channel_(chrome::VersionInfo::CHANNEL_UNKNOWN) { 27 ~ScopedCurrentChannel();
28 original_channel_ = GetCurrentChannel();
29 SetCurrentChannel(channel);
30 }
31
32 ~ScopedCurrentChannel() {
33 SetCurrentChannel(original_channel_);
34 }
35 28
36 private: 29 private:
37 chrome::VersionInfo::Channel original_channel_; 30 chrome::VersionInfo::Channel original_channel_;
31
32 DISALLOW_COPY_AND_ASSIGN(ScopedCurrentChannel);
38 }; 33 };
39 34
40 } // namespace extensions 35 } // namespace extensions
41 36
42 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_ 37 #endif // CHROME_COMMON_EXTENSIONS_FEATURES_FEATURE_CHANNEL_H_
OLDNEW
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/extensions/features/feature_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698