| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 typedef std::map<std::string, VersionInfo::Channel> ChannelsMap; | 55 typedef std::map<std::string, VersionInfo::Channel> ChannelsMap; |
| 56 ChannelsMap channels = g_mappings.Get().channels; | 56 ChannelsMap channels = g_mappings.Get().channels; |
| 57 for (ChannelsMap::iterator i = channels.begin(); i != channels.end(); ++i) { | 57 for (ChannelsMap::iterator i = channels.begin(); i != channels.end(); ++i) { |
| 58 if (i->second == channel) | 58 if (i->second == channel) |
| 59 return i->first; | 59 return i->first; |
| 60 } | 60 } |
| 61 NOTREACHED(); | 61 NOTREACHED(); |
| 62 return "unknown"; | 62 return "unknown"; |
| 63 } | 63 } |
| 64 | 64 |
| 65 VersionInfo::Channel g_current_channel = VersionInfo::CHANNEL_STABLE; | 65 const VersionInfo::Channel kDefaultChannel = VersionInfo::CHANNEL_STABLE; |
| 66 VersionInfo::Channel g_current_channel = kDefaultChannel; |
| 66 | 67 |
| 67 // TODO(aa): Can we replace all this manual parsing with JSON schema stuff? | 68 // TODO(aa): Can we replace all this manual parsing with JSON schema stuff? |
| 68 | 69 |
| 69 void ParseSet(const DictionaryValue* value, | 70 void ParseSet(const DictionaryValue* value, |
| 70 const std::string& property, | 71 const std::string& property, |
| 71 std::set<std::string>* set) { | 72 std::set<std::string>* set) { |
| 72 const ListValue* list_value = NULL; | 73 const ListValue* list_value = NULL; |
| 73 if (!value->GetList(property, &list_value)) | 74 if (!value->GetList(property, &list_value)) |
| 74 return; | 75 return; |
| 75 | 76 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // static | 328 // static |
| 328 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { | 329 chrome::VersionInfo::Channel Feature::GetCurrentChannel() { |
| 329 return g_current_channel; | 330 return g_current_channel; |
| 330 } | 331 } |
| 331 | 332 |
| 332 // static | 333 // static |
| 333 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { | 334 void Feature::SetCurrentChannel(VersionInfo::Channel channel) { |
| 334 g_current_channel = channel; | 335 g_current_channel = channel; |
| 335 } | 336 } |
| 336 | 337 |
| 338 // static |
| 339 chrome::VersionInfo::Channel Feature::GetDefaultChannel() { |
| 340 return kDefaultChannel; |
| 341 } |
| 342 |
| 337 } // namespace | 343 } // namespace |
| OLD | NEW |