Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 343743004: Implement a permission check for push. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add content settings html sections Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"}, 100 {CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, "auto-select-certificate"},
101 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"}, 101 {CONTENT_SETTINGS_TYPE_FULLSCREEN, "fullscreen"},
102 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"}, 102 {CONTENT_SETTINGS_TYPE_MOUSELOCK, "mouselock"},
103 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "register-protocol-handler"}, 103 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "register-protocol-handler"},
104 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"}, 104 {CONTENT_SETTINGS_TYPE_MEDIASTREAM, "media-stream"},
105 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "media-stream-mic"}, 105 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, "media-stream-mic"},
106 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "media-stream-camera"}, 106 {CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, "media-stream-camera"},
107 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, "ppapi-broker"}, 107 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, "ppapi-broker"},
108 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, "multiple-automatic-downloads"}, 108 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, "multiple-automatic-downloads"},
109 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, "midi-sysex"}, 109 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, "midi-sysex"},
110 {CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, "push-messaging"},
110 #if defined(OS_CHROMEOS) 111 #if defined(OS_CHROMEOS)
111 {CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"}, 112 {CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, "protectedContent"},
112 #endif 113 #endif
113 }; 114 };
114 115
115 // A pseudo content type. We use it to display data like a content setting even 116 // A pseudo content type. We use it to display data like a content setting even
116 // though it is not a real content setting. 117 // though it is not a real content setting.
117 const char* kZoomContentType = "zoomlevels"; 118 const char* kZoomContentType = "zoomlevels";
118 119
119 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) { 120 ContentSettingsType ContentSettingsTypeFromGroupName(const std::string& name) {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 IDS_AUTOMATIC_DOWNLOADS_ALLOW_RADIO }, 408 IDS_AUTOMATIC_DOWNLOADS_ALLOW_RADIO },
408 { "multiple-automatic-downloads_ask", 409 { "multiple-automatic-downloads_ask",
409 IDS_AUTOMATIC_DOWNLOADS_ASK_RADIO }, 410 IDS_AUTOMATIC_DOWNLOADS_ASK_RADIO },
410 { "multiple-automatic-downloads_block", 411 { "multiple-automatic-downloads_block",
411 IDS_AUTOMATIC_DOWNLOADS_BLOCK_RADIO }, 412 IDS_AUTOMATIC_DOWNLOADS_BLOCK_RADIO },
412 // MIDI system exclusive messages 413 // MIDI system exclusive messages
413 { "midi-sysex_header", IDS_MIDI_SYSEX_TAB_LABEL }, 414 { "midi-sysex_header", IDS_MIDI_SYSEX_TAB_LABEL },
414 { "midiSysExAllow", IDS_MIDI_SYSEX_ALLOW_RADIO }, 415 { "midiSysExAllow", IDS_MIDI_SYSEX_ALLOW_RADIO },
415 { "midiSysExAsk", IDS_MIDI_SYSEX_ASK_RADIO }, 416 { "midiSysExAsk", IDS_MIDI_SYSEX_ASK_RADIO },
416 { "midiSysExBlock", IDS_MIDI_SYSEX_BLOCK_RADIO }, 417 { "midiSysExBlock", IDS_MIDI_SYSEX_BLOCK_RADIO },
418 // Push messaging strings
419 { "push-messaging_header", IDS_PUSH_MESSAGES_TAB_LABEL },
420 { "pushMessagingAllow", IDS_PUSH_MESSSAGING_ALLOW_RADIO },
421 { "pushMessagingAsk", IDS_PUSH_MESSSAGING_ASK_RADIO },
422 { "pushMessagingBlock", IDS_PUSH_MESSSAGING_BLOCK_RADIO },
417 { "zoomlevels_header", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL }, 423 { "zoomlevels_header", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL },
418 { "zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON }, 424 { "zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON },
419 }; 425 };
420 426
421 RegisterStrings(localized_strings, resources, arraysize(resources)); 427 RegisterStrings(localized_strings, resources, arraysize(resources));
422 RegisterTitle(localized_strings, "contentSettingsPage", 428 RegisterTitle(localized_strings, "contentSettingsPage",
423 IDS_CONTENT_SETTINGS_TITLE); 429 IDS_CONTENT_SETTINGS_TITLE);
424 430
425 // Register titles for each of the individual settings whose exception 431 // Register titles for each of the individual settings whose exception
426 // dialogs will be processed by |ContentSettingsHandler|. 432 // dialogs will be processed by |ContentSettingsHandler|.
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1560 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { 1566 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() {
1561 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); 1567 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
1562 // Exceptions apply only when the feature is enabled. 1568 // Exceptions apply only when the feature is enabled.
1563 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1569 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1564 web_ui()->CallJavascriptFunction( 1570 web_ui()->CallJavascriptFunction(
1565 "ContentSettings.enableProtectedContentExceptions", 1571 "ContentSettings.enableProtectedContentExceptions",
1566 base::FundamentalValue(enable_exceptions)); 1572 base::FundamentalValue(enable_exceptions));
1567 } 1573 }
1568 1574
1569 } // namespace options 1575 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/content_settings/content_setting_bubble_cocoa.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698