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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: rebase + blink reformat Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 757ec244d3c5e7d3ae691d216fd6a4e6f4ee0761..836350bddcae35ce9e8f19a8f2f681dc4f3bb822 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -185,6 +185,7 @@ const ExceptionsInfoMap& GetExceptionsInfoMap() {
ContentSettingWithExceptions(
false,
UserMetricsAction("Options_DefaultMIDISysExSettingChanged"))));
+ // TODO(riju): Add sensor metrics when UMA is added.
exceptions_info_map.insert(std::make_pair(
CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC,
ContentSettingWithExceptions(
@@ -464,6 +465,12 @@ void ContentSettingsHandler::GetLocalizedValues(
{"midiSysExAllow", IDS_MIDI_SYSEX_ALLOW_RADIO},
{"midiSysExAsk", IDS_MIDI_SYSEX_ASK_RADIO},
{"midiSysExBlock", IDS_MIDI_SYSEX_BLOCK_RADIO},
+ // Sensors filter.
+ {"sensorsHeader", IDS_SENSORS_TAB_LABEL},
+ {"sensorsAllow", IDS_SENSORS_ALLOW_RADIO},
+ {"sensorsAsk", IDS_SENSORS_ASK_RADIO},
+ {"sensorsBlock", IDS_SENSORS_BLOCK_RADIO},
+
// Push messaging strings.
{"pushMessagingHeader", IDS_PUSH_MESSAGES_TAB_LABEL},
{"pushMessagingAllow", IDS_PUSH_MESSSAGING_ALLOW_RADIO},
@@ -545,6 +552,7 @@ void ContentSettingsHandler::GetLocalizedValues(
IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL);
RegisterTitle(localized_strings, "midi-sysex",
IDS_MIDI_SYSEX_TAB_LABEL);
+ RegisterTitle(localized_strings, "sensors", IDS_SENSORS_TAB_LABEL);
RegisterTitle(localized_strings, "usb-devices",
IDS_USB_DEVICES_HEADER_AND_TAB_LABEL);
RegisterTitle(localized_strings, "background-sync",
@@ -809,6 +817,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromModel(
UpdateExceptionsViewFromHostContentSettingsMap(type);
} else if (type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX) {
UpdateMIDISysExExceptionsView();
+ } else if (type == CONTENT_SETTINGS_TYPE_SENSORS) {
+ UpdateSensorsExceptionsView();
} else {
UpdateExceptionsViewFromHostContentSettingsMap(type);
}
@@ -973,6 +983,11 @@ void ContentSettingsHandler::UpdateMIDISysExExceptionsView() {
CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
}
+void ContentSettingsHandler::UpdateSensorsExceptionsView() {
+ UpdateSettingDefaultFromModel(CONTENT_SETTINGS_TYPE_SENSORS);
+ UpdateExceptionsViewFromHostContentSettingsMap(CONTENT_SETTINGS_TYPE_SENSORS);
+}
+
void ContentSettingsHandler::UpdateAllChooserExceptionsViewsFromModel() {
for (const site_settings::ChooserTypeNameEntry& chooser_type :
site_settings::kChooserTypeGroupNames)
« no previous file with comments | « chrome/browser/ui/webui/options/content_settings_handler.h ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698