OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 UserMetrics::RecordAction(UserMetricsAction("StartupTick")); | 672 UserMetrics::RecordAction(UserMetricsAction("StartupTick")); |
673 } | 673 } |
674 | 674 |
675 ////////////////////////////////////////////////////////////////////////////// | 675 ////////////////////////////////////////////////////////////////////////////// |
676 // FlagsState implementation. | 676 // FlagsState implementation. |
677 | 677 |
678 namespace { | 678 namespace { |
679 | 679 |
680 void FlagsState::ConvertFlagsToSwitches( | 680 void FlagsState::ConvertFlagsToSwitches( |
681 PrefService* prefs, CommandLine* command_line) { | 681 PrefService* prefs, CommandLine* command_line) { |
| 682 // TODO(thakis): Reenable. |
| 683 #if 0 |
682 if (command_line->HasSwitch(switches::kNoExperiments)) | 684 if (command_line->HasSwitch(switches::kNoExperiments)) |
683 return; | 685 return; |
684 | 686 |
685 std::set<std::string> enabled_experiments; | 687 std::set<std::string> enabled_experiments; |
686 | 688 |
687 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); | 689 GetSanitizedEnabledFlagsForCurrentPlatform(prefs, &enabled_experiments); |
688 | 690 |
689 typedef std::map<std::string, std::pair<std::string, std::string> > | 691 typedef std::map<std::string, std::pair<std::string, std::string> > |
690 NameToSwitchAndValueMap; | 692 NameToSwitchAndValueMap; |
691 NameToSwitchAndValueMap name_to_switch_map; | 693 NameToSwitchAndValueMap name_to_switch_map; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 switch_and_value_pair = name_to_switch_it->second; | 725 switch_and_value_pair = name_to_switch_it->second; |
724 | 726 |
725 command_line->AppendSwitchASCII(switch_and_value_pair.first, | 727 command_line->AppendSwitchASCII(switch_and_value_pair.first, |
726 switch_and_value_pair.second); | 728 switch_and_value_pair.second); |
727 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; | 729 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
728 } | 730 } |
729 command_line->AppendSwitch(switches::kFlagSwitchesEnd); | 731 command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
730 flags_switches_.insert( | 732 flags_switches_.insert( |
731 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, | 733 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
732 std::string())); | 734 std::string())); |
| 735 #endif |
733 } | 736 } |
734 | 737 |
735 bool FlagsState::IsRestartNeededToCommitChanges() { | 738 bool FlagsState::IsRestartNeededToCommitChanges() { |
736 return needs_restart_; | 739 return needs_restart_; |
737 } | 740 } |
738 | 741 |
739 void FlagsState::SetExperimentEnabled( | 742 void FlagsState::SetExperimentEnabled( |
740 PrefService* prefs, const std::string& internal_name, bool enable) { | 743 PrefService* prefs, const std::string& internal_name, bool enable) { |
741 needs_restart_ = true; | 744 needs_restart_ = true; |
742 | 745 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 } | 836 } |
834 | 837 |
835 const Experiment* GetExperiments(size_t* count) { | 838 const Experiment* GetExperiments(size_t* count) { |
836 *count = num_experiments; | 839 *count = num_experiments; |
837 return experiments; | 840 return experiments; |
838 } | 841 } |
839 | 842 |
840 } // namespace testing | 843 } // namespace testing |
841 | 844 |
842 } // namespace about_flags | 845 } // namespace about_flags |
OLD | NEW |