Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: chrome/browser/about_flags.cc

Issue 369703002: Remember user decisions on invalid certificates behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed several bot compile errors Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 kOsDesktop, 1928 kOsDesktop,
1905 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions) 1929 SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
1906 }, 1930 },
1907 { 1931 {
1908 "enable-website-settings-manager", 1932 "enable-website-settings-manager",
1909 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME, 1933 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_NAME,
1910 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION, 1934 IDS_FLAGS_ENABLE_WEBSITE_SETTINGS_DESCRIPTION,
1911 kOsDesktop, 1935 kOsDesktop,
1912 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager) 1936 SINGLE_VALUE_TYPE(switches::kEnableWebsiteSettingsManager)
1913 }, 1937 },
1938 {
1939 "remember-cert-error-decisions",
1940 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_NAME,
1941 IDS_FLAGS_REMEMBER_CERTIFICATE_ERROR_DECISIONS_DESCRIPTION,
1942 kOsAll,
1943 MULTI_VALUE_TYPE(kRememberCertificateErrorDecisionsChoices)
1944 },
1914 }; 1945 };
1915 1946
1916 const Experiment* experiments = kExperiments; 1947 const Experiment* experiments = kExperiments;
1917 size_t num_experiments = arraysize(kExperiments); 1948 size_t num_experiments = arraysize(kExperiments);
1918 1949
1919 // Stores and encapsulates the little state that about:flags has. 1950 // Stores and encapsulates the little state that about:flags has.
1920 class FlagsState { 1951 class FlagsState {
1921 public: 1952 public:
1922 FlagsState() : needs_restart_(false) {} 1953 FlagsState() : needs_restart_(false) {}
1923 void ConvertFlagsToSwitches(FlagsStorage* flags_storage, 1954 void ConvertFlagsToSwitches(FlagsStorage* flags_storage,
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 } 2463 }
2433 2464
2434 const Experiment* GetExperiments(size_t* count) { 2465 const Experiment* GetExperiments(size_t* count) {
2435 *count = num_experiments; 2466 *count = num_experiments;
2436 return experiments; 2467 return experiments;
2437 } 2468 }
2438 2469
2439 } // namespace testing 2470 } // namespace testing
2440 2471
2441 } // namespace about_flags 2472 } // namespace about_flags
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698