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

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

Issue 10854177: Only set the channel from ExtensionSystem if there hasn't been one set already. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « chrome/common/extensions/features/feature.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 VersionInfo::Channel g_default_channel = VersionInfo::CHANNEL_STABLE;
Matt Perry 2012/08/15 23:13:02 make it a const? kDefaultChannel
not at google - send to devlin 2012/08/15 23:16:10 Done.
66 VersionInfo::Channel g_current_channel = g_default_channel;
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
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 g_default_channel;
341 }
342
337 } // namespace 343 } // namespace
OLDNEW
« no previous file with comments | « chrome/common/extensions/features/feature.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698