| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 : has_otr_exceptions(otr), uma(action) {} | 95 : has_otr_exceptions(otr), uma(action) {} |
| 96 bool has_otr_exceptions; | 96 bool has_otr_exceptions; |
| 97 UserMetricsAction uma; | 97 UserMetricsAction uma; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // The AppFilter is used in AddExceptionsGrantedByHostedApps() to choose | 100 // The AppFilter is used in AddExceptionsGrantedByHostedApps() to choose |
| 101 // extensions which should have their extent displayed. | 101 // extensions which should have their extent displayed. |
| 102 typedef bool (*AppFilter)(const extensions::Extension& app, | 102 typedef bool (*AppFilter)(const extensions::Extension& app, |
| 103 content::BrowserContext* profile); | 103 content::BrowserContext* profile); |
| 104 | 104 |
| 105 const char kExceptionsLearnMoreUrl[] = | |
| 106 "https://support.google.com/chrome/?p=settings_manage_exceptions"; | |
| 107 | |
| 108 const char kAppName[] = "appName"; | 105 const char kAppName[] = "appName"; |
| 109 const char kAppId[] = "appId"; | 106 const char kAppId[] = "appId"; |
| 110 const char kZoom[] = "zoom"; | 107 const char kZoom[] = "zoom"; |
| 111 | 108 |
| 112 // A pseudo content type. We use it to display data like a content setting even | 109 // A pseudo content type. We use it to display data like a content setting even |
| 113 // though it is not a real content setting. | 110 // though it is not a real content setting. |
| 114 const char kZoomContentType[] = "zoomlevels"; | 111 const char kZoomContentType[] = "zoomlevels"; |
| 115 | 112 |
| 116 // Maps from a content settings type to a content setting with exceptions | 113 // Maps from a content settings type to a content setting with exceptions |
| 117 // struct. | 114 // struct. |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 RegisterTitle(localized_strings, "midi-sysex", | 546 RegisterTitle(localized_strings, "midi-sysex", |
| 550 IDS_MIDI_SYSEX_TAB_LABEL); | 547 IDS_MIDI_SYSEX_TAB_LABEL); |
| 551 RegisterTitle(localized_strings, "usb-devices", | 548 RegisterTitle(localized_strings, "usb-devices", |
| 552 IDS_USB_DEVICES_HEADER_AND_TAB_LABEL); | 549 IDS_USB_DEVICES_HEADER_AND_TAB_LABEL); |
| 553 RegisterTitle(localized_strings, "background-sync", | 550 RegisterTitle(localized_strings, "background-sync", |
| 554 IDS_BACKGROUND_SYNC_HEADER); | 551 IDS_BACKGROUND_SYNC_HEADER); |
| 555 RegisterTitle(localized_strings, "zoomlevels", | 552 RegisterTitle(localized_strings, "zoomlevels", |
| 556 IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); | 553 IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL); |
| 557 | 554 |
| 558 localized_strings->SetString("exceptionsLearnMoreUrl", | 555 localized_strings->SetString("exceptionsLearnMoreUrl", |
| 559 kExceptionsLearnMoreUrl); | 556 chrome::kContentSettingsExceptionsLearnMoreURL); |
| 560 } | 557 } |
| 561 | 558 |
| 562 void ContentSettingsHandler::InitializeHandler() { | 559 void ContentSettingsHandler::InitializeHandler() { |
| 563 notification_registrar_.Add( | 560 notification_registrar_.Add( |
| 564 this, chrome::NOTIFICATION_PROFILE_CREATED, | 561 this, chrome::NOTIFICATION_PROFILE_CREATED, |
| 565 content::NotificationService::AllSources()); | 562 content::NotificationService::AllSources()); |
| 566 notification_registrar_.Add( | 563 notification_registrar_.Add( |
| 567 this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 564 this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 568 content::NotificationService::AllSources()); | 565 content::NotificationService::AllSources()); |
| 569 | 566 |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 | 1490 |
| 1494 // Exceptions apply only when the feature is enabled. | 1491 // Exceptions apply only when the feature is enabled. |
| 1495 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1492 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
| 1496 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1493 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
| 1497 web_ui()->CallJavascriptFunctionUnsafe( | 1494 web_ui()->CallJavascriptFunctionUnsafe( |
| 1498 "ContentSettings.enableProtectedContentExceptions", | 1495 "ContentSettings.enableProtectedContentExceptions", |
| 1499 base::FundamentalValue(enable_exceptions)); | 1496 base::FundamentalValue(enable_exceptions)); |
| 1500 } | 1497 } |
| 1501 | 1498 |
| 1502 } // namespace options | 1499 } // namespace options |
| OLD | NEW |