OLD | NEW |
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/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 | 14 |
15 using chrome::VersionInfo; | 15 using chrome::VersionInfo; |
16 using extensions::Extension; | |
17 | 16 |
18 namespace { | 17 namespace { |
19 | 18 |
20 const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE; | 19 const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE; |
21 VersionInfo::Channel g_current_channel = kDefaultChannel; | 20 VersionInfo::Channel g_current_channel = kDefaultChannel; |
22 | 21 |
23 } // namespace | 22 } // namespace |
24 | 23 |
25 namespace extensions { | 24 namespace extensions { |
26 | 25 |
27 // static | 26 // static |
28 Feature::Platform Feature::GetCurrentPlatform() { | 27 Feature::Platform Feature::GetCurrentPlatform() { |
29 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
30 return CHROMEOS_PLATFORM; | 29 return CHROMEOS_PLATFORM; |
31 #else | 30 #else |
32 return UNSPECIFIED_PLATFORM; | 31 return UNSPECIFIED_PLATFORM; |
33 #endif | 32 #endif |
34 } | 33 } |
35 | 34 |
36 // static | 35 // static |
37 Feature::Location Feature::ConvertLocation(Extension::Location location) { | 36 Feature::Location Feature::ConvertLocation(Manifest::Location location) { |
38 if (location == Extension::COMPONENT) | 37 if (location == Manifest::COMPONENT) |
39 return COMPONENT_LOCATION; | 38 return COMPONENT_LOCATION; |
40 else | 39 else |
41 return UNSPECIFIED_LOCATION; | 40 return UNSPECIFIED_LOCATION; |
42 } | 41 } |
43 | 42 |
44 // static | 43 // static |
45 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { | 44 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { |
46 return g_current_channel; | 45 return g_current_channel; |
47 } | 46 } |
48 | 47 |
49 // static | 48 // static |
50 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { | 49 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { |
51 g_current_channel = channel; | 50 g_current_channel = channel; |
52 } | 51 } |
53 | 52 |
54 // static | 53 // static |
55 chrome::VersionInfo::Channel Feature::GetDefaultChannel() { | 54 chrome::VersionInfo::Channel Feature::GetDefaultChannel() { |
56 return kDefaultChannel; | 55 return kDefaultChannel; |
57 } | 56 } |
58 | 57 |
59 Feature::~Feature() {} | 58 Feature::~Feature() {} |
60 | 59 |
61 } // namespace extensions | 60 } // namespace extensions |
OLD | NEW |