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

Side by Side Diff: chrome/common/extensions/features/feature.cc

Issue 22299009: Move channel-related (Chrome-specific) global state out of Feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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.h" 5 #include "chrome/common/extensions/features/feature.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 14
15 using chrome::VersionInfo;
16
17 namespace {
18
19 const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE;
20 VersionInfo::Channel g_current_channel = kDefaultChannel;
21
22 } // namespace
23
24 namespace extensions { 15 namespace extensions {
25 16
26 // static 17 // static
27 Feature::Platform Feature::GetCurrentPlatform() { 18 Feature::Platform Feature::GetCurrentPlatform() {
28 #if defined(OS_CHROMEOS) 19 #if defined(OS_CHROMEOS)
29 return CHROMEOS_PLATFORM; 20 return CHROMEOS_PLATFORM;
30 #else 21 #else
31 return UNSPECIFIED_PLATFORM; 22 return UNSPECIFIED_PLATFORM;
32 #endif 23 #endif
33 } 24 }
34 25
35 // static 26 // static
36 Feature::Location Feature::ConvertLocation(Manifest::Location location) { 27 Feature::Location Feature::ConvertLocation(Manifest::Location location) {
37 if (location == Manifest::COMPONENT) 28 if (location == Manifest::COMPONENT)
38 return COMPONENT_LOCATION; 29 return COMPONENT_LOCATION;
39 else 30 else
40 return UNSPECIFIED_LOCATION; 31 return UNSPECIFIED_LOCATION;
41 } 32 }
42 33
43 // static 34 // static
44 chrome::VersionInfo::Channel Feature::GetCurrentChannel() {
45 return g_current_channel;
46 }
47
48 // static
49 void Feature::SetCurrentChannel(VersionInfo::Channel channel) {
50 g_current_channel = channel;
51 }
52
53 // static
54 chrome::VersionInfo::Channel Feature::GetDefaultChannel() {
55 return kDefaultChannel;
56 }
57
58 // static
59 Feature::Availability Feature::CreateAvailability(AvailabilityResult result, 35 Feature::Availability Feature::CreateAvailability(AvailabilityResult result,
60 const std::string& message) { 36 const std::string& message) {
61 return Availability(result, message); 37 return Availability(result, message);
62 } 38 }
63 39
64 Feature::Feature() : no_parent_(false) {} 40 Feature::Feature() : no_parent_(false) {}
65 41
66 Feature::~Feature() {} 42 Feature::~Feature() {}
67 43
68 } // namespace extensions 44 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/feature.h ('k') | chrome/common/extensions/features/feature_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698