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