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" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return base::StringPrintf( | 239 return base::StringPrintf( |
240 "'%s' requires manifest version of %d or lower.", | 240 "'%s' requires manifest version of %d or lower.", |
241 name().c_str(), | 241 name().c_str(), |
242 max_manifest_version_); | 242 max_manifest_version_); |
243 case NOT_PRESENT: | 243 case NOT_PRESENT: |
244 return base::StringPrintf( | 244 return base::StringPrintf( |
245 "'%s' requires a different Feature that is not present.", | 245 "'%s' requires a different Feature that is not present.", |
246 name().c_str()); | 246 name().c_str()); |
247 case UNSUPPORTED_CHANNEL: | 247 case UNSUPPORTED_CHANNEL: |
248 return base::StringPrintf( | 248 return base::StringPrintf( |
249 "'%s' requires Google Chrome %s channel or newer.", | 249 "'%s' requires Google Chrome %s channel or newer, and we're running " |
| 250 "on the %s channel.", |
250 name().c_str(), | 251 name().c_str(), |
251 GetChannelName(channel_).c_str()); | 252 GetChannelName(channel_).c_str(), |
| 253 GetChannelName(GetCurrentChannel()).c_str()); |
252 } | 254 } |
253 | 255 |
254 return ""; | 256 return ""; |
255 } | 257 } |
256 | 258 |
257 Feature::Availability Feature::IsAvailableToManifest( | 259 Feature::Availability Feature::IsAvailableToManifest( |
258 const std::string& extension_id, | 260 const std::string& extension_id, |
259 Extension::Type type, | 261 Extension::Type type, |
260 Location location, | 262 Location location, |
261 int manifest_version, | 263 int manifest_version, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { | 330 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { |
329 return g_current_channel; | 331 return g_current_channel; |
330 } | 332 } |
331 | 333 |
332 // static | 334 // static |
333 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { | 335 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { |
334 g_current_channel = channel; | 336 g_current_channel = channel; |
335 } | 337 } |
336 | 338 |
337 } // namespace | 339 } // namespace |
OLD | NEW |