| 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/metrics/metrics_service.h" | 9 #include "chrome/browser/metrics/metrics_service.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| 11 #include "chrome/common/pref_service.h" | 11 #include "chrome/common/pref_service.h" |
| 12 #include "chrome/installer/util/google_update_settings.h" | 12 #include "chrome/installer/util/google_update_settings.h" |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 void OptionsUtil::ResetToDefaults(Profile* profile) { | 15 void OptionsUtil::ResetToDefaults(Profile* profile) { |
| 16 // TODO(tc): It would be nice if we could generate this list automatically so | 16 // 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 | 17 // changes to any of the options pages doesn't require updating this list |
| 18 // manually. | 18 // manually. |
| 19 PrefService* prefs = profile->GetPrefs(); | 19 PrefService* prefs = profile->GetPrefs(); |
| 20 const wchar_t* kUserPrefs[] = { | 20 const wchar_t* kUserPrefs[] = { |
| 21 prefs::kAcceptLanguages, | 21 prefs::kAcceptLanguages, |
| 22 prefs::kAlternateErrorPagesEnabled, | 22 prefs::kAlternateErrorPagesEnabled, |
| 23 prefs::kCookieBehavior, | 23 prefs::kCookieBehavior, |
| 24 prefs::kDefaultCharset, | 24 prefs::kDefaultCharset, |
| 25 prefs::kDnsPrefetchingEnabled, | 25 prefs::kDnsPrefetchingEnabled, |
| 26 prefs::kDownloadDefaultDirectory, | 26 prefs::kDownloadDefaultDirectory, |
| 27 prefs::kDownloadExtensionsToOpen, | 27 prefs::kDownloadExtensionsToOpen, |
| 28 prefs::kEnableSpellCheck, |
| 28 prefs::kFormAutofillEnabled, | 29 prefs::kFormAutofillEnabled, |
| 29 prefs::kHomePage, | 30 prefs::kHomePage, |
| 30 prefs::kHomePageIsNewTabPage, | 31 prefs::kHomePageIsNewTabPage, |
| 31 prefs::kMixedContentFiltering, | 32 prefs::kMixedContentFiltering, |
| 32 prefs::kPromptForDownload, | 33 prefs::kPromptForDownload, |
| 33 prefs::kPasswordManagerEnabled, | 34 prefs::kPasswordManagerEnabled, |
| 34 prefs::kRestoreOnStartup, | 35 prefs::kRestoreOnStartup, |
| 35 prefs::kSafeBrowsingEnabled, | 36 prefs::kSafeBrowsingEnabled, |
| 36 prefs::kSearchSuggestEnabled, | 37 prefs::kSearchSuggestEnabled, |
| 37 prefs::kShowHomeButton, | 38 prefs::kShowHomeButton, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 if (metrics) { | 87 if (metrics) { |
| 87 metrics->SetUserPermitsUpload(enabled); | 88 metrics->SetUserPermitsUpload(enabled); |
| 88 if (enabled) | 89 if (enabled) |
| 89 metrics->Start(); | 90 metrics->Start(); |
| 90 else | 91 else |
| 91 metrics->Stop(); | 92 metrics->Stop(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 return enabled; | 95 return enabled; |
| 95 } | 96 } |
| OLD | NEW |