| 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" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
| 18 #include "chrome/browser/extensions/extension_util.h" | 18 #include "chrome/browser/extensions/extension_util.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/options/options_util.h" | 20 #include "chrome/browser/ui/options/options_util.h" |
| 21 #include "chrome/common/net/url_fixer_upper.h" | |
| 22 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "components/url_fixer/url_fixer.h" |
| 24 #include "content/public/browser/notification_details.h" | 24 #include "content/public/browser/notification_details.h" |
| 25 #include "content/public/browser/notification_types.h" | 25 #include "content/public/browser/notification_types.h" |
| 26 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
| 27 #include "content/public/browser/web_ui.h" | 27 #include "content/public/browser/web_ui.h" |
| 28 #include "extensions/browser/extension_pref_value_map.h" | 28 #include "extensions/browser/extension_pref_value_map.h" |
| 29 #include "extensions/browser/extension_pref_value_map_factory.h" | 29 #include "extensions/browser/extension_pref_value_map_factory.h" |
| 30 #include "extensions/browser/extension_registry.h" | 30 #include "extensions/browser/extension_registry.h" |
| 31 #include "extensions/browser/extension_system.h" | 31 #include "extensions/browser/extension_system.h" |
| 32 #include "extensions/common/extension.h" | 32 #include "extensions/common/extension.h" |
| 33 #include "grit/chromium_strings.h" | 33 #include "grit/chromium_strings.h" |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 NOTREACHED(); | 570 NOTREACHED(); |
| 571 return; | 571 return; |
| 572 } | 572 } |
| 573 break; | 573 break; |
| 574 case TYPE_URL: { | 574 case TYPE_URL: { |
| 575 std::string original; | 575 std::string original; |
| 576 if (!value->GetAsString(&original)) { | 576 if (!value->GetAsString(&original)) { |
| 577 NOTREACHED(); | 577 NOTREACHED(); |
| 578 return; | 578 return; |
| 579 } | 579 } |
| 580 GURL fixed = URLFixerUpper::FixupURL(original, std::string()); | 580 GURL fixed = url_fixer::FixupURL(original, std::string()); |
| 581 temp_value.reset(new base::StringValue(fixed.spec())); | 581 temp_value.reset(new base::StringValue(fixed.spec())); |
| 582 value = temp_value.get(); | 582 value = temp_value.get(); |
| 583 break; | 583 break; |
| 584 } | 584 } |
| 585 case TYPE_LIST: { | 585 case TYPE_LIST: { |
| 586 // In case we have a List pref we got a JSON string. | 586 // In case we have a List pref we got a JSON string. |
| 587 std::string json_string; | 587 std::string json_string; |
| 588 if (!value->GetAsString(&json_string)) { | 588 if (!value->GetAsString(&json_string)) { |
| 589 NOTREACHED(); | 589 NOTREACHED(); |
| 590 return; | 590 return; |
| (...skipping 60 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 |