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_ONE_DAY, |
| 503 switches::kRememberCertErrorDecisions, |
| 504 "86400" }, |
| 505 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS, |
| 506 switches::kRememberCertErrorDecisions, |
| 507 "259200" }, |
| 508 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK, |
| 509 switches::kRememberCertErrorDecisions, |
| 510 "604800" }, |
| 511 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH, |
| 512 switches::kRememberCertErrorDecisions, |
| 513 "2592000" }, |
| 514 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_MONTHS, |
| 515 switches::kRememberCertErrorDecisions, |
| 516 "7776000" }, |
| 517 }; |
| 518 |
495 // RECORDING USER METRICS FOR FLAGS: | 519 // RECORDING USER METRICS FOR FLAGS: |
496 // ----------------------------------------------------------------------------- | 520 // ----------------------------------------------------------------------------- |
497 // The first line of the experiment is the internal name. If you'd like to | 521 // 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 | 522 // gather statistics about the usage of your flag, you should append a marker |
499 // comment to the end of the feature name, like so: | 523 // comment to the end of the feature name, like so: |
500 // "my-special-feature", // FLAGS:RECORD_UMA | 524 // "my-special-feature", // FLAGS:RECORD_UMA |
501 // | 525 // |
502 // After doing that, run | 526 // After doing that, run |
503 // tools/metrics/actions/extract_actions.py | 527 // tools/metrics/actions/extract_actions.py |
504 // to add the metric to actions.xml (which will enable UMA to record your | 528 // 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, | 1944 kOsDesktop, |
1921 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) | 1945 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) |
1922 }, | 1946 }, |
1923 { | 1947 { |
1924 "enable-website-settings-manager", | 1948 "enable-website-settings-manager", |
1925 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, | 1949 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, |
1926 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, | 1950 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, |
1927 kOsDesktop, | 1951 kOsDesktop, |
1928 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) | 1952 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) |
1929 }, | 1953 }, |
| 1954 { |
| 1955 "remember-cert-error-decisions", |
| 1956 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME, |
| 1957 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION, |
| 1958 kOsAll, |
| 1959 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices) |
| 1960 }, |
1930 }; | 1961 }; |
1931 | 1962 |
1932 const Experiment* experiments = kExperiments; | 1963 const Experiment* experiments = kExperiments; |
1933 size_t num_experiments = arraysize(kExperiments); | 1964 size_t num_experiments = arraysize(kExperiments); |
1934 | 1965 |
1935 // Stores and encapsulates the little state that about:flags has. | 1966 // Stores and encapsulates the little state that about:flags has. |
1936 class FlagsState { | 1967 class FlagsState { |
1937 public: | 1968 public: |
1938 FlagsState() : needs_restart_(false) {} | 1969 FlagsState() : needs_restart_(false) {} |
1939 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 1970 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2448 } | 2479 } |
2449 | 2480 |
2450 const Experiment* GetExperiments(size_t* count) { | 2481 const Experiment* GetExperiments(size_t* count) { |
2451 *count = num_experiments; | 2482 *count = num_experiments; |
2452 return experiments; | 2483 return experiments; |
2453 } | 2484 } |
2454 | 2485 |
2455 } // namespace testing | 2486 } // namespace testing |
2456 | 2487 |
2457 } // namespace about_flags | 2488 } // namespace about_flags |
OLD | NEW |