| 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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 kOsDesktop, | 1919 kOsDesktop, |
| 1896 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) | 1920 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) |
| 1897 }, | 1921 }, |
| 1898 { | 1922 { |
| 1899 "enable-website-settings-manager", | 1923 "enable-website-settings-manager", |
| 1900 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, | 1924 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, |
| 1901 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, | 1925 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, |
| 1902 kOsDesktop, | 1926 kOsDesktop, |
| 1903 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) | 1927 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) |
| 1904 }, | 1928 }, |
| 1929 { |
| 1930 "remember-cert-error-decisions", |
| 1931 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME, |
| 1932 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION, |
| 1933 kOsAll, |
| 1934 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices) |
| 1935 }, |
| 1905 }; | 1936 }; |
| 1906 | 1937 |
| 1907 const Experiment* experiments = kExperiments; | 1938 const Experiment* experiments = kExperiments; |
| 1908 size_t num_experiments = arraysize(kExperiments); | 1939 size_t num_experiments = arraysize(kExperiments); |
| 1909 | 1940 |
| 1910 // Stores and encapsulates the little state that about:flags has. | 1941 // Stores and encapsulates the little state that about:flags has. |
| 1911 class FlagsState { | 1942 class FlagsState { |
| 1912 public: | 1943 public: |
| 1913 FlagsState() : needs_restart_(false) {} | 1944 FlagsState() : needs_restart_(false) {} |
| 1914 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 1945 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2423 } | 2454 } |
| 2424 | 2455 |
| 2425 const Experiment* GetExperiments(size_t* count) { | 2456 const Experiment* GetExperiments(size_t* count) { |
| 2426 *count = num_experiments; | 2457 *count = num_experiments; |
| 2427 return experiments; | 2458 return experiments; |
| 2428 } | 2459 } |
| 2429 | 2460 |
| 2430 } // namespace testing | 2461 } // namespace testing |
| 2431 | 2462 |
| 2432 } // namespace about_flags | 2463 } // namespace about_flags |
| OLD | NEW |