Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/options/options_util.h" | 5 #include "chrome/browser/ui/options/options_util.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_restrictions.h" | 7 #include "base/threading/thread_restrictions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 10 #include "chrome/browser/download/download_manager.h" | 10 #include "chrome/browser/download/download_manager.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 prefs::kCookieBehavior, | 31 prefs::kCookieBehavior, |
| 32 prefs::kDefaultCharset, | 32 prefs::kDefaultCharset, |
| 33 prefs::kDefaultZoomLevel, | 33 prefs::kDefaultZoomLevel, |
| 34 prefs::kDeleteBrowsingHistory, | 34 prefs::kDeleteBrowsingHistory, |
| 35 prefs::kDeleteCache, | 35 prefs::kDeleteCache, |
| 36 prefs::kDeleteCookies, | 36 prefs::kDeleteCookies, |
| 37 prefs::kDeleteDownloadHistory, | 37 prefs::kDeleteDownloadHistory, |
| 38 prefs::kDeleteFormData, | 38 prefs::kDeleteFormData, |
| 39 prefs::kDeletePasswords, | 39 prefs::kDeletePasswords, |
| 40 prefs::kDnsPrefetchingEnabled, | 40 prefs::kDnsPrefetchingEnabled, |
| 41 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) | |
|
wtc
2011/04/05 18:40:37
IMPORTANT: should we keep this ifdef, since Mac an
ramant (doing other things)
2011/04/05 21:01:36
Hi Wan-Teh,
We access these preferences in user_
| |
| 42 prefs::kCertRevocationCheckingEnabled, | 41 prefs::kCertRevocationCheckingEnabled, |
| 43 prefs::kSSL3Enabled, | 42 prefs::kSSL3Enabled, |
| 44 prefs::kTLS1Enabled, | 43 prefs::kTLS1Enabled, |
| 45 #endif | |
| 46 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
| 47 prefs::kTapToClickEnabled, | 45 prefs::kTapToClickEnabled, |
| 48 prefs::kTouchpadSensitivity, | 46 prefs::kTouchpadSensitivity, |
| 49 #endif | 47 #endif |
| 50 prefs::kDownloadDefaultDirectory, | 48 prefs::kDownloadDefaultDirectory, |
| 51 prefs::kDownloadExtensionsToOpen, | 49 prefs::kDownloadExtensionsToOpen, |
| 52 prefs::kSavingBrowserHistoryDisabled, | 50 prefs::kSavingBrowserHistoryDisabled, |
| 53 prefs::kEnableSpellCheck, | 51 prefs::kEnableSpellCheck, |
| 54 prefs::kEnableTranslate, | 52 prefs::kEnableTranslate, |
| 55 prefs::kAutofillEnabled, | 53 prefs::kAutofillEnabled, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 PrefService* local_state = g_browser_process->local_state(); | 87 PrefService* local_state = g_browser_process->local_state(); |
| 90 // Note that we don't reset the kMetricsReportingEnabled preference here | 88 // Note that we don't reset the kMetricsReportingEnabled preference here |
| 91 // because the reset will reset it to the default setting specified in Chrome | 89 // because the reset will reset it to the default setting specified in Chrome |
| 92 // source, not the default setting selected by the user on the web page where | 90 // source, not the default setting selected by the user on the web page where |
| 93 // they downloaded Chrome. This means that if the user ever resets their | 91 // they downloaded Chrome. This means that if the user ever resets their |
| 94 // settings they'll either inadvertedly enable this logging or disable it. | 92 // settings they'll either inadvertedly enable this logging or disable it. |
| 95 // One is undesirable for them, one is undesirable for us. For now, we just | 93 // One is undesirable for them, one is undesirable for us. For now, we just |
| 96 // don't reset it. | 94 // don't reset it. |
| 97 const char* kLocalStatePrefs[] = { | 95 const char* kLocalStatePrefs[] = { |
| 98 prefs::kApplicationLocale, | 96 prefs::kApplicationLocale, |
| 99 #if defined(OS_LINUX) || defined(OS_FREEBSD) || defined(OS_OPENBSD) | |
| 100 prefs::kCertRevocationCheckingEnabled, | 97 prefs::kCertRevocationCheckingEnabled, |
| 101 prefs::kSSL3Enabled, | 98 prefs::kSSL3Enabled, |
| 102 prefs::kTLS1Enabled, | 99 prefs::kTLS1Enabled, |
| 103 #endif | |
| 104 }; | 100 }; |
| 105 for (size_t i = 0; i < arraysize(kLocalStatePrefs); ++i) | 101 for (size_t i = 0; i < arraysize(kLocalStatePrefs); ++i) |
| 106 local_state->ClearPref(kLocalStatePrefs[i]); | 102 local_state->ClearPref(kLocalStatePrefs[i]); |
| 107 } | 103 } |
| 108 | 104 |
| 109 // static | 105 // static |
| 110 bool OptionsUtil::ResolveMetricsReportingEnabled(bool enabled) { | 106 bool OptionsUtil::ResolveMetricsReportingEnabled(bool enabled) { |
| 111 // GoogleUpdateSettings touches the disk from the UI thread. MetricsService | 107 // GoogleUpdateSettings touches the disk from the UI thread. MetricsService |
| 112 // also calls GoogleUpdateSettings below. http://crbug/62626 | 108 // also calls GoogleUpdateSettings below. http://crbug/62626 |
| 113 base::ThreadRestrictions::ScopedAllowIO allow_io; | 109 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 128 if (metrics) { | 124 if (metrics) { |
| 129 metrics->SetUserPermitsUpload(enabled); | 125 metrics->SetUserPermitsUpload(enabled); |
| 130 if (enabled) | 126 if (enabled) |
| 131 metrics->Start(); | 127 metrics->Start(); |
| 132 else | 128 else |
| 133 metrics->Stop(); | 129 metrics->Stop(); |
| 134 } | 130 } |
| 135 | 131 |
| 136 return enabled; | 132 return enabled; |
| 137 } | 133 } |
| OLD | NEW |