| Index: chrome/browser/ui/webui/options/content_settings_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| index 7f76ed8e30956ef86aae6aadb7dc6105dba238b5..cd26c255b8190fdfc0da54452e572ad43e0f025d 100644
|
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| @@ -11,6 +11,7 @@
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/content_settings/content_settings_details.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map.h"
|
| +#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
|
| #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
|
| #include "chrome/browser/notifications/desktop_notification_service.h"
|
| #include "chrome/browser/notifications/desktop_notification_service_factory.h"
|
| @@ -199,6 +200,7 @@ void ContentSettingsHandler::GetLocalizedValues(
|
| { "examplePattern", IDS_EXCEPTIONS_PATTERN_EXAMPLE },
|
| { "addNewExceptionInstructions", IDS_EXCEPTIONS_ADD_NEW_INSTRUCTIONS },
|
| { "manage_exceptions", IDS_EXCEPTIONS_MANAGE },
|
| + { "manage_handlers", IDS_HANDLERS_MANAGE },
|
| { "exceptionPatternHeader", IDS_EXCEPTIONS_PATTERN_HEADER },
|
| { "exceptionBehaviorHeader", IDS_EXCEPTIONS_ACTION_HEADER },
|
| // Cookies filter.
|
| @@ -271,6 +273,7 @@ void ContentSettingsHandler::Initialize() {
|
| this, NotificationType::PROFILE_DESTROYED,
|
| NotificationService::AllSources());
|
|
|
| + UpdateHandlersEnabledRadios();
|
| UpdateAllExceptionsViewsFromModel();
|
| notification_registrar_.Add(
|
| this, NotificationType::CONTENT_SETTINGS_CHANGED,
|
| @@ -281,6 +284,9 @@ void ContentSettingsHandler::Initialize() {
|
| notification_registrar_.Add(
|
| this, NotificationType::DESKTOP_NOTIFICATION_SETTINGS_CHANGED,
|
| NotificationService::AllSources());
|
| + notification_registrar_.Add(
|
| + this, NotificationType::PROTOCOL_HANDLER_REGISTRY_CHANGED,
|
| + NotificationService::AllSources());
|
|
|
| PrefService* prefs = web_ui_->GetProfile()->GetPrefs();
|
| pref_change_registrar_.Init(prefs);
|
| @@ -337,6 +343,11 @@ void ContentSettingsHandler::Observe(NotificationType type,
|
| break;
|
| }
|
|
|
| + case NotificationType::PROTOCOL_HANDLER_REGISTRY_CHANGED: {
|
| + UpdateHandlersEnabledRadios();
|
| + break;
|
| + }
|
| +
|
| default:
|
| OptionsPageUIHandler::Observe(type, source, details);
|
| }
|
| @@ -383,6 +394,14 @@ bool ContentSettingsHandler::GetDefaultSettingManagedFromModel(
|
| }
|
| }
|
|
|
| +void ContentSettingsHandler::UpdateHandlersEnabledRadios() {
|
| + DCHECK(web_ui_);
|
| + FundamentalValue* handlers_enabled = Value::CreateBooleanValue(
|
| + GetProtocolHandlerRegistry()->enabled());
|
| + web_ui_->CallJavascriptFunction("ContentSettings.updateHandlersEnabledRadios",
|
| + *handlers_enabled);
|
| +}
|
| +
|
| void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() {
|
| for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1;
|
| type < CONTENT_SETTINGS_NUM_TYPES; ++type) {
|
| @@ -721,6 +740,10 @@ HostContentSettingsMap* ContentSettingsHandler::GetContentSettingsMap() {
|
| return web_ui_->GetProfile()->GetHostContentSettingsMap();
|
| }
|
|
|
| +ProtocolHandlerRegistry* ContentSettingsHandler::GetProtocolHandlerRegistry() {
|
| + return web_ui_->GetProfile()->GetProtocolHandlerRegistry();
|
| +}
|
| +
|
| HostContentSettingsMap*
|
| ContentSettingsHandler::GetOTRContentSettingsMap() {
|
| Profile* profile = web_ui_->GetProfile();
|
|
|