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/content_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 true, | 149 true, |
150 UserMetricsAction("Options_DefaultPPAPIBrokerSettingChanged")))); | 150 UserMetricsAction("Options_DefaultPPAPIBrokerSettingChanged")))); |
151 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 151 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
152 exceptions_info_map.insert(std::make_pair( | 152 exceptions_info_map.insert(std::make_pair( |
153 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, | 153 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, |
154 ContentSettingWithExceptions( | 154 ContentSettingWithExceptions( |
155 true, | 155 true, |
156 UserMetricsAction( | 156 UserMetricsAction( |
157 "Options_DefaultProtectedMediaIdentifierSettingChanged")))); | 157 "Options_DefaultProtectedMediaIdentifierSettingChanged")))); |
158 #endif | 158 #endif |
159 exceptions_info_map.insert(std::make_pair( | |
160 CONTENT_SETTINGS_TYPE_KEYGEN, | |
161 ContentSettingWithExceptions( | |
162 true, UserMetricsAction("Options_DefaultKeygenSettingChanged")))); | |
163 | 159 |
164 // Without OTR exceptions. | 160 // Without OTR exceptions. |
165 exceptions_info_map.insert(std::make_pair( | 161 exceptions_info_map.insert(std::make_pair( |
166 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 162 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
167 ContentSettingWithExceptions( | 163 ContentSettingWithExceptions( |
168 false, | 164 false, |
169 UserMetricsAction("Options_DefaultNotificationsSettingChanged")))); | 165 UserMetricsAction("Options_DefaultNotificationsSettingChanged")))); |
170 exceptions_info_map.insert(std::make_pair( | 166 exceptions_info_map.insert(std::make_pair( |
171 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 167 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
172 ContentSettingWithExceptions( | 168 ContentSettingWithExceptions( |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 // USB devices. | 473 // USB devices. |
478 {"usbDevicesHeader", IDS_USB_DEVICES_HEADER_AND_TAB_LABEL}, | 474 {"usbDevicesHeader", IDS_USB_DEVICES_HEADER_AND_TAB_LABEL}, |
479 {"usbDevicesManage", IDS_USB_DEVICES_MANAGE_BUTTON}, | 475 {"usbDevicesManage", IDS_USB_DEVICES_MANAGE_BUTTON}, |
480 // Background sync. | 476 // Background sync. |
481 {"backgroundSyncHeader", IDS_BACKGROUND_SYNC_HEADER}, | 477 {"backgroundSyncHeader", IDS_BACKGROUND_SYNC_HEADER}, |
482 {"backgroundSyncAllow", IDS_BACKGROUND_SYNC_ALLOW_RADIO}, | 478 {"backgroundSyncAllow", IDS_BACKGROUND_SYNC_ALLOW_RADIO}, |
483 {"backgroundSyncBlock", IDS_BACKGROUND_SYNC_BLOCK_RADIO}, | 479 {"backgroundSyncBlock", IDS_BACKGROUND_SYNC_BLOCK_RADIO}, |
484 // Zoom levels. | 480 // Zoom levels. |
485 {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, | 481 {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, |
486 {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, | 482 {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, |
487 // Keygen filter. | |
488 {"keygenTabLabel", IDS_KEYGEN_TAB_LABEL}, | |
489 {"keygenHeader", IDS_KEYGEN_HEADER}, | |
490 {"keygenAllow", IDS_KEYGEN_ALLOW_RADIO}, | |
491 {"keygenBlock", IDS_KEYGEN_DONOTALLOW_RADIO}, | |
492 // PDF Plugin filter. | 483 // PDF Plugin filter. |
493 {"pdfTabLabel", IDS_PDF_TAB_LABEL}, | 484 {"pdfTabLabel", IDS_PDF_TAB_LABEL}, |
494 {"pdfEnable", IDS_PDF_ENABLE_CHECKBOX}, | 485 {"pdfEnable", IDS_PDF_ENABLE_CHECKBOX}, |
495 }; | 486 }; |
496 | 487 |
497 RegisterStrings(localized_strings, resources, arraysize(resources)); | 488 RegisterStrings(localized_strings, resources, arraysize(resources)); |
498 | 489 |
499 // TODO(tommycli): When the HTML5 By Default feature flag is on, we want to | 490 // TODO(tommycli): When the HTML5 By Default feature flag is on, we want to |
500 // display strings that begin with "Ask...", even though the setting remains | 491 // display strings that begin with "Ask...", even though the setting remains |
501 // DETECT. Once this feature is finalized, then we migrate the setting to ASK. | 492 // DETECT. Once this feature is finalized, then we migrate the setting to ASK. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 RegisterTitle(localized_strings, "multiple-automatic-downloads", | 545 RegisterTitle(localized_strings, "multiple-automatic-downloads", |
555 IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL); | 546 IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL); |
556 RegisterTitle(localized_strings, "midi-sysex", | 547 RegisterTitle(localized_strings, "midi-sysex", |
557 IDS_MIDI_SYSEX_TAB_LABEL); | 548 IDS_MIDI_SYSEX_TAB_LABEL); |
558 RegisterTitle(localized_strings, "usb-devices", | 549 RegisterTitle(localized_strings, "usb-devices", |
559 IDS_USB_DEVICES_HEADER_AND_TAB_LABEL); | 550 IDS_USB_DEVICES_HEADER_AND_TAB_LABEL); |
560 RegisterTitle(localized_strings, "background-sync", | 551 RegisterTitle(localized_strings, "background-sync", |
561 IDS_BACKGROUND_SYNC_HEADER); | 552 IDS_BACKGROUND_SYNC_HEADER); |
562 RegisterTitle(localized_strings, "zoomlevels", | 553 RegisterTitle(localized_strings, "zoomlevels", |
563 IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); | 554 IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); |
564 RegisterTitle(localized_strings, "keygen", IDS_KEYGEN_TAB_LABEL); | |
565 | 555 |
566 localized_strings->SetString("exceptionsLearnMoreUrl", | 556 localized_strings->SetString("exceptionsLearnMoreUrl", |
567 kExceptionsLearnMoreUrl); | 557 kExceptionsLearnMoreUrl); |
568 } | 558 } |
569 | 559 |
570 void ContentSettingsHandler::InitializeHandler() { | 560 void ContentSettingsHandler::InitializeHandler() { |
571 notification_registrar_.Add( | 561 notification_registrar_.Add( |
572 this, chrome::NOTIFICATION_PROFILE_CREATED, | 562 this, chrome::NOTIFICATION_PROFILE_CREATED, |
573 content::NotificationService::AllSources()); | 563 content::NotificationService::AllSources()); |
574 notification_registrar_.Add( | 564 notification_registrar_.Add( |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1501 | 1491 |
1502 // Exceptions apply only when the feature is enabled. | 1492 // Exceptions apply only when the feature is enabled. |
1503 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1493 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1504 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1494 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1505 web_ui()->CallJavascriptFunctionUnsafe( | 1495 web_ui()->CallJavascriptFunctionUnsafe( |
1506 "ContentSettings.enableProtectedContentExceptions", | 1496 "ContentSettings.enableProtectedContentExceptions", |
1507 base::FundamentalValue(enable_exceptions)); | 1497 base::FundamentalValue(enable_exceptions)); |
1508 } | 1498 } |
1509 | 1499 |
1510 } // namespace options | 1500 } // namespace options |
OLD | NEW |