| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/options_util.h" | 5 #include "chrome/browser/options_util.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/download/download_manager.h" |
| 9 #include "chrome/browser/metrics/metrics_service.h" | 10 #include "chrome/browser/metrics/metrics_service.h" |
| 10 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/common/pref_service.h" | 12 #include "chrome/common/pref_service.h" |
| 12 #include "chrome/installer/util/google_update_settings.h" | 13 #include "chrome/installer/util/google_update_settings.h" |
| 13 | 14 |
| 14 // static | 15 // static |
| 15 void OptionsUtil::ResetToDefaults(Profile* profile) { | 16 void OptionsUtil::ResetToDefaults(Profile* profile) { |
| 16 // TODO(tc): It would be nice if we could generate this list automatically so | 17 // TODO(tc): It would be nice if we could generate this list automatically so |
| 17 // changes to any of the options pages doesn't require updating this list | 18 // changes to any of the options pages doesn't require updating this list |
| 18 // manually. | 19 // manually. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 47 prefs::kWebKitDefaultFixedFontSize, | 48 prefs::kWebKitDefaultFixedFontSize, |
| 48 prefs::kWebKitDefaultFontSize, | 49 prefs::kWebKitDefaultFontSize, |
| 49 prefs::kWebKitFixedFontFamily, | 50 prefs::kWebKitFixedFontFamily, |
| 50 prefs::kWebKitJavaEnabled, | 51 prefs::kWebKitJavaEnabled, |
| 51 prefs::kWebKitJavascriptEnabled, | 52 prefs::kWebKitJavascriptEnabled, |
| 52 prefs::kWebKitLoadsImagesAutomatically, | 53 prefs::kWebKitLoadsImagesAutomatically, |
| 53 prefs::kWebKitPluginsEnabled, | 54 prefs::kWebKitPluginsEnabled, |
| 54 prefs::kWebKitSansSerifFontFamily, | 55 prefs::kWebKitSansSerifFontFamily, |
| 55 prefs::kWebKitSerifFontFamily, | 56 prefs::kWebKitSerifFontFamily, |
| 56 }; | 57 }; |
| 58 profile->GetDownloadManager()->ResetAutoOpenFiles(); |
| 57 for (size_t i = 0; i < arraysize(kUserPrefs); ++i) | 59 for (size_t i = 0; i < arraysize(kUserPrefs); ++i) |
| 58 prefs->ClearPref(kUserPrefs[i]); | 60 prefs->ClearPref(kUserPrefs[i]); |
| 59 | 61 |
| 60 PrefService* local_state = g_browser_process->local_state(); | 62 PrefService* local_state = g_browser_process->local_state(); |
| 61 // Note that we don't reset the kMetricsReportingEnabled preference here | 63 // Note that we don't reset the kMetricsReportingEnabled preference here |
| 62 // because the reset will reset it to the default setting specified in Chrome | 64 // because the reset will reset it to the default setting specified in Chrome |
| 63 // source, not the default setting selected by the user on the web page where | 65 // source, not the default setting selected by the user on the web page where |
| 64 // they downloaded Chrome. This means that if the user ever resets their | 66 // they downloaded Chrome. This means that if the user ever resets their |
| 65 // settings they'll either inadvertedly enable this logging or disable it. | 67 // settings they'll either inadvertedly enable this logging or disable it. |
| 66 // One is undesirable for them, one is undesirable for us. For now, we just | 68 // One is undesirable for them, one is undesirable for us. For now, we just |
| (...skipping 26 matching lines...) Expand all Loading... |
| 93 if (metrics) { | 95 if (metrics) { |
| 94 metrics->SetUserPermitsUpload(enabled); | 96 metrics->SetUserPermitsUpload(enabled); |
| 95 if (enabled) | 97 if (enabled) |
| 96 metrics->Start(); | 98 metrics->Start(); |
| 97 else | 99 else |
| 98 metrics->Stop(); | 100 metrics->Stop(); |
| 99 } | 101 } |
| 100 | 102 |
| 101 return enabled; | 103 return enabled; |
| 102 } | 104 } |
| OLD | NEW |