| 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/ui/webui/options/core_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/core_options_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 void CoreOptionsHandler::InitializeHandler() { | 84 void CoreOptionsHandler::InitializeHandler() { |
| 85 Profile* profile = Profile::FromWebUI(web_ui()); | 85 Profile* profile = Profile::FromWebUI(web_ui()); |
| 86 | 86 |
| 87 plugin_status_pref_setter_.Init( | 87 plugin_status_pref_setter_.Init( |
| 88 profile, | 88 profile, |
| 89 base::Bind(&CoreOptionsHandler::OnPreferenceChanged, | 89 base::Bind(&CoreOptionsHandler::OnPreferenceChanged, |
| 90 base::Unretained(this), | 90 base::Unretained(this), |
| 91 profile->GetPrefs())); | 91 profile->GetPrefs())); |
| 92 | 92 |
| 93 pref_change_filters_[prefs::kMetricsReportingEnabled] = | 93 pref_change_filters_[metrics::prefs::kMetricsReportingEnabled] = |
| 94 base::Bind(&AllowMetricsReportingChange); | 94 base::Bind(&AllowMetricsReportingChange); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void CoreOptionsHandler::InitializePage() { | 97 void CoreOptionsHandler::InitializePage() { |
| 98 UpdateClearPluginLSOData(); | 98 UpdateClearPluginLSOData(); |
| 99 UpdatePepperFlashSettingsEnabled(); | 99 UpdatePepperFlashSettingsEnabled(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CoreOptionsHandler::GetLocalizedValues( | 102 void CoreOptionsHandler::GetLocalizedValues( |
| 103 base::DictionaryValue* localized_strings) { | 103 base::DictionaryValue* localized_strings) { |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } | 651 } |
| 652 | 652 |
| 653 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { | 653 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { |
| 654 base::FundamentalValue enabled( | 654 base::FundamentalValue enabled( |
| 655 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); | 655 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); |
| 656 web_ui()->CallJavascriptFunction( | 656 web_ui()->CallJavascriptFunction( |
| 657 "OptionsPage.setPepperFlashSettingsEnabled", enabled); | 657 "OptionsPage.setPepperFlashSettingsEnabled", enabled); |
| 658 } | 658 } |
| 659 | 659 |
| 660 } // namespace options | 660 } // namespace options |
| OLD | NEW |