| 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 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 } | 551 } |
| 552 break; | 552 break; |
| 553 case TYPE_INTEGER: { | 553 case TYPE_INTEGER: { |
| 554 // In JS all numbers are doubles. | 554 // In JS all numbers are doubles. |
| 555 double double_value; | 555 double double_value; |
| 556 if (!value->GetAsDouble(&double_value)) { | 556 if (!value->GetAsDouble(&double_value)) { |
| 557 NOTREACHED(); | 557 NOTREACHED(); |
| 558 return; | 558 return; |
| 559 } | 559 } |
| 560 int int_value = static_cast<int>(double_value); | 560 int int_value = static_cast<int>(double_value); |
| 561 temp_value.reset(new base::FundamentalValue(int_value)); | 561 temp_value.reset(new base::Value(int_value)); |
| 562 value = temp_value.get(); | 562 value = temp_value.get(); |
| 563 break; | 563 break; |
| 564 } | 564 } |
| 565 case TYPE_DOUBLE: | 565 case TYPE_DOUBLE: |
| 566 if (!value->IsType(base::Value::TYPE_DOUBLE)) { | 566 if (!value->IsType(base::Value::TYPE_DOUBLE)) { |
| 567 NOTREACHED(); | 567 NOTREACHED(); |
| 568 return; | 568 return; |
| 569 } | 569 } |
| 570 break; | 570 break; |
| 571 case TYPE_STRING: | 571 case TYPE_STRING: |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 Profile::FromWebUI(web_ui()))->extension_service(); | 639 Profile::FromWebUI(web_ui()))->extension_service(); |
| 640 DCHECK(extension_service); | 640 DCHECK(extension_service); |
| 641 extension_service->DisableExtension( | 641 extension_service->DisableExtension( |
| 642 extension_id, extensions::Extension::DISABLE_USER_ACTION); | 642 extension_id, extensions::Extension::DISABLE_USER_ACTION); |
| 643 } else { | 643 } else { |
| 644 NOTREACHED(); | 644 NOTREACHED(); |
| 645 } | 645 } |
| 646 } | 646 } |
| 647 | 647 |
| 648 void CoreOptionsHandler::UpdateClearPluginLSOData() { | 648 void CoreOptionsHandler::UpdateClearPluginLSOData() { |
| 649 base::FundamentalValue enabled( | 649 base::Value enabled( |
| 650 plugin_status_pref_setter_.IsClearPluginLSODataEnabled()); | 650 plugin_status_pref_setter_.IsClearPluginLSODataEnabled()); |
| 651 web_ui()->CallJavascriptFunctionUnsafe( | 651 web_ui()->CallJavascriptFunctionUnsafe( |
| 652 "options.OptionsPage.setClearPluginLSODataEnabled", enabled); | 652 "options.OptionsPage.setClearPluginLSODataEnabled", enabled); |
| 653 } | 653 } |
| 654 | 654 |
| 655 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { | 655 void CoreOptionsHandler::UpdatePepperFlashSettingsEnabled() { |
| 656 base::FundamentalValue enabled( | 656 base::Value enabled( |
| 657 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); | 657 plugin_status_pref_setter_.IsPepperFlashSettingsEnabled()); |
| 658 web_ui()->CallJavascriptFunctionUnsafe( | 658 web_ui()->CallJavascriptFunctionUnsafe( |
| 659 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); | 659 "options.OptionsPage.setPepperFlashSettingsEnabled", enabled); |
| 660 } | 660 } |
| 661 | 661 |
| 662 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { | 662 bool CoreOptionsHandler::IsUserUnsupervised(const base::Value* to_value) { |
| 663 return !Profile::FromWebUI(web_ui())->IsSupervised(); | 663 return !Profile::FromWebUI(web_ui())->IsSupervised(); |
| 664 } | 664 } |
| 665 | 665 |
| 666 } // namespace options | 666 } // namespace options |
| OLD | NEW |