| 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 #ifndef CHROME_BROWSER_ABOUT_FLAGS_H_ | 5 #ifndef CHROME_BROWSER_ABOUT_FLAGS_H_ |
| 6 #define CHROME_BROWSER_ABOUT_FLAGS_H_ | 6 #define CHROME_BROWSER_ABOUT_FLAGS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 16 #include "base/metrics/histogram_base.h" | 17 #include "base/metrics/histogram_base.h" |
| 17 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 18 #include "components/flags_ui/feature_entry.h" | 19 #include "components/flags_ui/feature_entry.h" |
| 19 #include "components/flags_ui/flags_state.h" | 20 #include "components/flags_ui/flags_state.h" |
| 20 | 21 |
| 21 namespace base { | 22 namespace base { |
| 22 class FeatureList; | 23 class FeatureList; |
| 23 class ListValue; | 24 class ListValue; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace flags_ui { | 27 namespace flags_ui { |
| 27 class FlagsStorage; | 28 class FlagsStorage; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace about_flags { | 31 namespace about_flags { |
| 31 | 32 |
| 32 // Reads the state from |flags_storage| and adds the command line flags | 33 // Reads the state from |flags_storage| and adds the command line flags |
| 33 // belonging to the active feature entries to |command_line|. | 34 // belonging to the active feature entries to |command_line|. |
| 34 void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, | 35 void ConvertFlagsToSwitches(flags_ui::FlagsStorage* flags_storage, |
| 35 base::CommandLine* command_line, | 36 base::CommandLine* command_line, |
| 36 flags_ui::SentinelsMode sentinels); | 37 flags_ui::SentinelsMode sentinels); |
| 37 | 38 |
| 38 // Registers variations parameter values selected for features in about:flags. | 39 // Registers variations parameter values selected for features in about:flags. |
| 39 // The selected flags are retrieved from |flags_storage|, the registered | 40 // The selected flags are retrieved from |flags_storage|, the registered |
| 40 // variation parameters are connected to their corresponding features in | 41 // variation parameters are connected to their corresponding features in |
| 41 // |feature_list|. | 42 // |feature_list|. Returns the (possibly empty) list of additional variation ids |
| 42 void RegisterAllFeatureVariationParameters( | 43 // to register in the MetricsService that come from variations selected using |
| 44 // chrome://flags. |
| 45 std::vector<std::string> RegisterAllFeatureVariationParameters( |
| 43 flags_ui::FlagsStorage* flags_storage, | 46 flags_ui::FlagsStorage* flags_storage, |
| 44 base::FeatureList* feature_list); | 47 base::FeatureList* feature_list); |
| 45 | 48 |
| 46 // Compares a set of switches of the two provided command line objects and | 49 // Compares a set of switches of the two provided command line objects and |
| 47 // returns true if they are the same and false otherwise. | 50 // returns true if they are the same and false otherwise. |
| 48 // If |out_difference| is not NULL, it's filled with set_symmetric_difference | 51 // If |out_difference| is not NULL, it's filled with set_symmetric_difference |
| 49 // between sets. | 52 // between sets. |
| 50 bool AreSwitchesIdenticalToCurrentCommandLine( | 53 bool AreSwitchesIdenticalToCurrentCommandLine( |
| 51 const base::CommandLine& new_cmdline, | 54 const base::CommandLine& new_cmdline, |
| 52 const base::CommandLine& active_cmdline, | 55 const base::CommandLine& active_cmdline, |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 101 |
| 99 // This value is reported as switch histogram ID if switch name has unknown | 102 // This value is reported as switch histogram ID if switch name has unknown |
| 100 // format. | 103 // format. |
| 101 extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId; | 104 extern const base::HistogramBase::Sample kBadSwitchFormatHistogramId; |
| 102 | 105 |
| 103 } // namespace testing | 106 } // namespace testing |
| 104 | 107 |
| 105 } // namespace about_flags | 108 } // namespace about_flags |
| 106 | 109 |
| 107 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_ | 110 #endif // CHROME_BROWSER_ABOUT_FLAGS_H_ |
| OLD | NEW |