| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 11 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 17 #include "base/values.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 340 } |
| 340 | 341 |
| 341 content::RecordComputedAction(metric_string); | 342 content::RecordComputedAction(metric_string); |
| 342 } | 343 } |
| 343 | 344 |
| 344 void CoreOptionsHandler::NotifyPrefChanged( | 345 void CoreOptionsHandler::NotifyPrefChanged( |
| 345 const std::string& pref_name, | 346 const std::string& pref_name, |
| 346 const std::string& controlling_pref_name) { | 347 const std::string& controlling_pref_name) { |
| 347 scoped_ptr<base::Value> value( | 348 scoped_ptr<base::Value> value( |
| 348 CreateValueForPref(pref_name, controlling_pref_name)); | 349 CreateValueForPref(pref_name, controlling_pref_name)); |
| 349 DispatchPrefChangeNotification(pref_name, value.Pass()); | 350 DispatchPrefChangeNotification(pref_name, std::move(value)); |
| 350 } | 351 } |
| 351 | 352 |
| 352 void CoreOptionsHandler::DispatchPrefChangeNotification( | 353 void CoreOptionsHandler::DispatchPrefChangeNotification( |
| 353 const std::string& name, | 354 const std::string& name, |
| 354 scoped_ptr<base::Value> value) { | 355 scoped_ptr<base::Value> value) { |
| 355 std::pair<PreferenceCallbackMap::const_iterator, | 356 std::pair<PreferenceCallbackMap::const_iterator, |
| 356 PreferenceCallbackMap::const_iterator> range = | 357 PreferenceCallbackMap::const_iterator> range = |
| 357 pref_callback_map_.equal_range(name); | 358 pref_callback_map_.equal_range(name); |
| 358 base::ListValue result_value; | 359 base::ListValue result_value; |
| 359 result_value.Append(new base::StringValue(name.c_str())); | 360 result_value.Append(new base::StringValue(name.c_str())); |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); | 657 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); |
| 657 web_ui()->CallJavascriptFunction( | 658 web_ui()->CallJavascriptFunction( |
| 658 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); | 659 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); |
| 659 } | 660 } |
| 660 | 661 |
| 661 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { | 662 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { |
| 662 return !Profile::FromWebUI(web_ui())->IsSupervised(); | 663 return !Profile::FromWebUI(web_ui())->IsSupervised(); |
| 663 } | 664 } |
| 664 | 665 |
| 665 } // namespace options | 666 } // namespace options |
| OLD | NEW |