Chromium Code Reviews| 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 484 #endif | 484 #endif |
| 485 | 485 |
| 486 const Experiment::Choice kEnableSettingsWindowChoices[] = { | 486 const Experiment::Choice kEnableSettingsWindowChoices[] = { |
| 487 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | 487 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, |
| 488 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, | 488 { IDS_GENERIC_EXPERIMENT_CHOICE_ENABLED, |
| 489 ::switches::kEnableSettingsWindow, "" }, | 489 ::switches::kEnableSettingsWindow, "" }, |
| 490 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, | 490 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, |
| 491 ::switches::kDisableSettingsWindow, "" }, | 491 ::switches::kDisableSettingsWindow, "" }, |
| 492 }; | 492 }; |
| 493 | 493 |
| 494 // Note that the value is specified in seconds (where 0 is equivalent to | |
| 495 // disabled). | |
| 496 const Experiment::Choice kRememberCertificateErrorDecisionsChoices[] = { | |
| 497 { IDS_GENERIC_EXPERIMENT_CHOICE_DEFAULT, "", "" }, | |
| 498 { IDS_GENERIC_EXPERIMENT_CHOICE_DISABLED, | |
| 499 switches::kRememberCertErrorDecisions, | |
|
felt
2014/07/07 22:26:39
FYI: FieldTrials doesn't currently support flag=va
jww
2014/07/08 17:35:41
Isn't it simpler than that? In my previous experim
felt
2014/07/08 17:52:48
If you want to track forcing flags, I believe you
jww
2014/07/08 23:49:01
Got it. I've switched to pure flags style.
| |
| 500 "0" }, | |
| 501 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_DAY, | |
| 502 switches::kRememberCertErrorDecisions, | |
| 503 "86400" }, | |
| 504 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_THREE_DAYS, | |
| 505 switches::kRememberCertErrorDecisions, | |
| 506 "259200" }, | |
| 507 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_WEEK, | |
| 508 switches::kRememberCertErrorDecisions, | |
| 509 "604800" }, | |
| 510 { IDS_REMEMBER_CERTIFICATE_ERROR_DECISION_CHOICE_ONE_MONTH, | |
| 511 switches::kRememberCertErrorDecisions, | |
| 512 "2592000" }, | |
| 513 }; | |
| 514 | |
| 494 // RECORDING USER METRICS FOR FLAGS: | 515 // RECORDING USER METRICS FOR FLAGS: |
| 495 // ----------------------------------------------------------------------------- | 516 // ----------------------------------------------------------------------------- |
| 496 // The first line of the experiment is the internal name. If you'd like to | 517 // The first line of the experiment is the internal name. If you'd like to |
| 497 // gather statistics about the usage of your flag, you should append a marker | 518 // gather statistics about the usage of your flag, you should append a marker |
| 498 // comment to the end of the feature name, like so: | 519 // comment to the end of the feature name, like so: |
| 499 // "my-special-feature", // FLAGS:RECORD_UMA | 520 // "my-special-feature", // FLAGS:RECORD_UMA |
| 500 // | 521 // |
| 501 // After doing that, run | 522 // After doing that, run |
| 502 // tools/metrics/actions/extract_actions.py | 523 // tools/metrics/actions/extract_actions.py |
| 503 // to add the metric to actions.xml (which will enable UMA to record your | 524 // to add the metric to actions.xml (which will enable UMA to record your |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1948 #endif | 1969 #endif |
| 1949 #if defined(OS_CHROMEOS) | 1970 #if defined(OS_CHROMEOS) |
| 1950 { | 1971 { |
| 1951 "enable-ok-google-voice-search", | 1972 "enable-ok-google-voice-search", |
| 1952 IDS_FLAGS_OK_GOOGLE_NAME, | 1973 IDS_FLAGS_OK_GOOGLE_NAME, |
| 1953 IDS_FLAGS_OK_GOOGLE_DESCRIPTION, | 1974 IDS_FLAGS_OK_GOOGLE_DESCRIPTION, |
| 1954 kOsCrOS, | 1975 kOsCrOS, |
| 1955 SINGLE_VALUE_TYPE(chromeos::switches::kEnableOkGoogleVoiceSearch) | 1976 SINGLE_VALUE_TYPE(chromeos::switches::kEnableOkGoogleVoiceSearch) |
| 1956 }, | 1977 }, |
| 1957 #endif | 1978 #endif |
| 1979 { | |
| 1980 "remember-cert-error-decisions", | |
| 1981 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME, | |
| 1982 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION, | |
| 1983 kOsAll, | |
| 1984 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices) | |
| 1985 }, | |
| 1958 }; | 1986 }; |
| 1959 | 1987 |
| 1960 const Experiment* experiments = kExperiments; | 1988 const Experiment* experiments = kExperiments; |
| 1961 size_t num_experiments = arraysize(kExperiments); | 1989 size_t num_experiments = arraysize(kExperiments); |
| 1962 | 1990 |
| 1963 // Stores and encapsulates the little state that about:flags has. | 1991 // Stores and encapsulates the little state that about:flags has. |
| 1964 class FlagsState { | 1992 class FlagsState { |
| 1965 public: | 1993 public: |
| 1966 FlagsState() : needs_restart_(false) {} | 1994 FlagsState() : needs_restart_(false) {} |
| 1967 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, | 1995 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2476 } | 2504 } |
| 2477 | 2505 |
| 2478 const Experiment* GetExperiments(size_t* count) { | 2506 const Experiment* GetExperiments(size_t* count) { |
| 2479 *count = num_experiments; | 2507 *count = num_experiments; |
| 2480 return experiments; | 2508 return experiments; |
| 2481 } | 2509 } |
| 2482 | 2510 |
| 2483 } // namespace testing | 2511 } // namespace testing |
| 2484 | 2512 |
| 2485 } // namespace about_flags | 2513 } // namespace about_flags |
| OLD | NEW |