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