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 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 e.command_line_value); | 697 e.command_line_value); |
698 } else { | 698 } else { |
699 for (int j = 0; j < e.num_choices; ++j) | 699 for (int j = 0; j < e.num_choices; ++j) |
700 name_to_switch_map[NameForChoice(e, j)] = | 700 name_to_switch_map[NameForChoice(e, j)] = |
701 std::pair<std::string, std::string>( | 701 std::pair<std::string, std::string>( |
702 e.choices[j].command_line_switch, | 702 e.choices[j].command_line_switch, |
703 e.choices[j].command_line_value); | 703 e.choices[j].command_line_value); |
704 } | 704 } |
705 } | 705 } |
706 | 706 |
| 707 // TODO(thakis): Reenable. |
| 708 #if 0 |
707 command_line->AppendSwitch(switches::kFlagSwitchesBegin); | 709 command_line->AppendSwitch(switches::kFlagSwitchesBegin); |
| 710 #endif |
708 flags_switches_.insert( | 711 flags_switches_.insert( |
709 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, | 712 std::pair<std::string, std::string>(switches::kFlagSwitchesBegin, |
710 std::string())); | 713 std::string())); |
711 for (std::set<std::string>::iterator it = enabled_experiments.begin(); | 714 for (std::set<std::string>::iterator it = enabled_experiments.begin(); |
712 it != enabled_experiments.end(); | 715 it != enabled_experiments.end(); |
713 ++it) { | 716 ++it) { |
714 const std::string& experiment_name = *it; | 717 const std::string& experiment_name = *it; |
715 NameToSwitchAndValueMap::const_iterator name_to_switch_it = | 718 NameToSwitchAndValueMap::const_iterator name_to_switch_it = |
716 name_to_switch_map.find(experiment_name); | 719 name_to_switch_map.find(experiment_name); |
717 if (name_to_switch_it == name_to_switch_map.end()) { | 720 if (name_to_switch_it == name_to_switch_map.end()) { |
718 NOTREACHED(); | 721 NOTREACHED(); |
719 continue; | 722 continue; |
720 } | 723 } |
721 | 724 |
722 const std::pair<std::string, std::string>& | 725 const std::pair<std::string, std::string>& |
723 switch_and_value_pair = name_to_switch_it->second; | 726 switch_and_value_pair = name_to_switch_it->second; |
724 | 727 |
| 728 // TODO(thakis): Reenable. |
| 729 #if 0 |
725 command_line->AppendSwitchASCII(switch_and_value_pair.first, | 730 command_line->AppendSwitchASCII(switch_and_value_pair.first, |
726 switch_and_value_pair.second); | 731 switch_and_value_pair.second); |
| 732 #endif |
727 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; | 733 flags_switches_[switch_and_value_pair.first] = switch_and_value_pair.second; |
728 } | 734 } |
| 735 // TODO(thakis): Reenable. |
| 736 #if 0 |
729 command_line->AppendSwitch(switches::kFlagSwitchesEnd); | 737 command_line->AppendSwitch(switches::kFlagSwitchesEnd); |
| 738 #endif |
730 flags_switches_.insert( | 739 flags_switches_.insert( |
731 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, | 740 std::pair<std::string, std::string>(switches::kFlagSwitchesEnd, |
732 std::string())); | 741 std::string())); |
733 } | 742 } |
734 | 743 |
735 bool FlagsState::IsRestartNeededToCommitChanges() { | 744 bool FlagsState::IsRestartNeededToCommitChanges() { |
736 return needs_restart_; | 745 return needs_restart_; |
737 } | 746 } |
738 | 747 |
739 void FlagsState::SetExperimentEnabled( | 748 void FlagsState::SetExperimentEnabled( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 } | 842 } |
834 | 843 |
835 const Experiment* GetExperiments(size_t* count) { | 844 const Experiment* GetExperiments(size_t* count) { |
836 *count = num_experiments; | 845 *count = num_experiments; |
837 return experiments; | 846 return experiments; |
838 } | 847 } |
839 | 848 |
840 } // namespace testing | 849 } // namespace testing |
841 | 850 |
842 } // namespace about_flags | 851 } // namespace about_flags |
OLD | NEW |