| 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 #include "chrome/browser/about_flags.h" | 5 #include "chrome/browser/about_flags.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 #endif | 485 #endif |
| 486 | 486 |
| 487 const Experiment::Choice kEnableSettingsWindowChoices[] = { | 487 const Experiment::Choice kEnableSettingsWindowChoices[] = { |
| 488 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | 488 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 489 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, | 489 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 490 ::switches::kEnableSettingsWindow, "" }, | 490 ::switches::kEnableSettingsWindow, "" }, |
| 491 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, | 491 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 492 ::switches::kDisableSettingsWindow, "" }, | 492 ::switches::kDisableSettingsWindow, "" }, |
| 493 }; | 493 }; |
| 494 | 494 |
| 495 // Note that the value is specified in seconds (where 0 is equivalent to |
| 496 // disabled). |
| 497 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = { |
| 498 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 499 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 500 switches::kRememberCertErrorDecisions, |
| 501 "-1" }, |
| 502 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_DO_NOT_REMEMBER, |
| 503 switches::kRememberCertErrorDecisions, |
| 504 "0" }, |
| 505 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY, |
| 506 switches::kRememberCertErrorDecisions, |
| 507 "86400" }, |
| 508 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS, |
| 509 switches::kRememberCertErrorDecisions, |
| 510 "259200" }, |
| 511 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK, |
| 512 switches::kRememberCertErrorDecisions, |
| 513 "604800" }, |
| 514 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH, |
| 515 switches::kRememberCertErrorDecisions, |
| 516 "2592000" }, |
| 517 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS, |
| 518 switches::kRememberCertErrorDecisions, |
| 519 "7776000" }, |
| 520 }; |
| 521 |
| 495 // RECORDING USER METRICS FOR FLAGS: | 522 // RECORDING USER METRICS FOR FLAGS: |
| 496 // ----------------------------------------------------------------------------- | 523 // ----------------------------------------------------------------------------- |
| 497 // The first line of the experiment is the internal name. If you'd like to | 524 // The first line of the experiment is the internal name. If you'd like to |
| 498 // gather statistics about the usage of your flag, you should append a marker | 525 // gather statistics about the usage of your flag, you should append a marker |
| 499 // comment to the end of the feature name, like so: | 526 // comment to the end of the feature name, like so: |
| 500 // "my-special-feature", // FLAGS:RECORD_UMA | 527 // "my-special-feature", // FLAGS:RECORD_UMA |
| 501 // | 528 // |
| 502 // After doing that, run | 529 // After doing that, run |
| 503 // tools/metrics/actions/extract_actions.py | 530 // tools/metrics/actions/extract_actions.py |
| 504 // to add the metric to actions.xml (which will enable UMA to record your | 531 // to add the metric to actions.xml (which will enable UMA to record your |
| (...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 kOsDesktop, | 1947 kOsDesktop, |
| 1921 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) | 1948 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) |
| 1922 }, | 1949 }, |
| 1923 { | 1950 { |
| 1924 "enable-website-settings-manager", | 1951 "enable-website-settings-manager", |
| 1925 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, | 1952 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, |
| 1926 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, | 1953 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, |
| 1927 kOsDesktop, | 1954 kOsDesktop, |
| 1928 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) | 1955 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) |
| 1929 }, | 1956 }, |
| 1957 { |
| 1958 "remember-cert-error-decisions", |
| 1959 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME, |
| 1960 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION, |
| 1961 kOsAll, |
| 1962 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices) |
| 1963 }, |
| 1930 }; | 1964 }; |
| 1931 | 1965 |
| 1932 const Experiment* experiments = kExperiments; | 1966 const Experiment* experiments = kExperiments; |
| 1933 size_t num_experiments = arraysize(kExperiments); | 1967 size_t num_experiments = arraysize(kExperiments); |
| 1934 | 1968 |
| 1935 // Stores and encapsulates the little state that about:flags has. | 1969 // Stores and encapsulates the little state that about:flags has. |
| 1936 class FlagsState { | 1970 class FlagsState { |
| 1937 public: | 1971 public: |
| 1938 FlagsState() : needs_restart_(false) {} | 1972 FlagsState() : needs_restart_(false) {} |
| 1939 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 1973 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 } | 2482 } |
| 2449 | 2483 |
| 2450 const Experiment* GetExperiments(size_t* count) { | 2484 const Experiment* GetExperiments(size_t* count) { |
| 2451 *count = num_experiments; | 2485 *count = num_experiments; |
| 2452 return experiments; | 2486 return experiments; |
| 2453 } | 2487 } |
| 2454 | 2488 |
| 2455 } // namespace testing | 2489 } // namespace testing |
| 2456 | 2490 |
| 2457 } // namespace about_flags | 2491 } // namespace about_flags |
| OLD | NEW |