Index: chrome/browser/content_settings/tab_specific_content_settings.cc |
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc |
index 1cb75700a645501b1c68d1bd58a5293155933d5f..f31c6f6a39db5e29ad0b796895733bc58dc7fbee 100644 |
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc |
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc |
@@ -98,6 +98,13 @@ TabSpecificContentSettings::TabSpecificContentSettings(WebContents* tab) |
HostContentSettingsMapFactory::GetForProfile( |
Profile::FromBrowserContext(tab->GetBrowserContext())), |
CONTENT_SETTINGS_TYPE_MIDI_SYSEX), |
+ // TODO(riju): when UMA is ready |
+ /* |
+ sensors_usages_state_( |
+ HostContentSettingsMapFactory::GetForProfile( |
+ Profile::FromBrowserContext(tab->GetBrowserContext())), |
+ CONTENT_SETTINGS_TYPE_SENSORS), |
+ */ |
pending_protocol_handler_(ProtocolHandler::EmptyProtocolHandler()), |
previous_protocol_handler_(ProtocolHandler::EmptyProtocolHandler()), |
pending_protocol_handler_setting_(CONTENT_SETTING_DEFAULT), |
@@ -250,6 +257,7 @@ bool TabSpecificContentSettings::IsContentBlocked( |
content_type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER || |
content_type == CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS || |
content_type == CONTENT_SETTINGS_TYPE_MIDI_SYSEX || |
+ // content_type == CONTENT_SETTINGS_TYPE_SENSORS || |
content_type == CONTENT_SETTINGS_TYPE_KEYGEN) { |
const auto& it = content_settings_status_.find(content_type); |
if (it != content_settings_status_.end()) |
@@ -293,6 +301,7 @@ bool TabSpecificContentSettings::IsContentAllowed( |
content_type != CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA && |
content_type != CONTENT_SETTINGS_TYPE_PPAPI_BROKER && |
content_type != CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS && |
+ // content_type != CONTENT_SETTINGS_TYPE_SENSORS && |
content_type != CONTENT_SETTINGS_TYPE_MIDI_SYSEX) { |
return false; |
} |
@@ -664,6 +673,16 @@ void TabSpecificContentSettings::OnMidiSysExAccessBlocked( |
OnContentBlocked(CONTENT_SETTINGS_TYPE_MIDI_SYSEX); |
} |
+void TabSpecificContentSettings::OnSensorAccessed( |
+ const GURL& requesting_origin) { |
+ OnContentAllowed(CONTENT_SETTINGS_TYPE_SENSORS); |
+} |
+ |
+void TabSpecificContentSettings::OnSensorAccessBlocked( |
+ const GURL& requesting_origin) { |
+ OnContentBlocked(CONTENT_SETTINGS_TYPE_SENSORS); |
+} |
+ |
void TabSpecificContentSettings:: |
ClearContentSettingsExceptForNavigationRelatedSettings() { |
for (auto& status : content_settings_status_) { |
@@ -817,6 +836,7 @@ void TabSpecificContentSettings::DidStartNavigation( |
ClearNavigationRelatedContentSettings(); |
ClearGeolocationContentSettings(); |
ClearMidiContentSettings(); |
+ // ClearSensorContentSettings(); |
ClearPendingProtocolHandler(); |
} |
@@ -833,6 +853,7 @@ void TabSpecificContentSettings::DidFinishNavigation( |
blocked_plugin_names_.clear(); |
GeolocationDidNavigate(navigation_handle); |
MidiDidNavigate(navigation_handle); |
+ // SensorDidNavigate(navigation_handle); |
if (web_contents()->GetVisibleURL().SchemeIsHTTPOrHTTPS()) { |
content_settings::RecordPluginsAction( |
@@ -874,6 +895,12 @@ void TabSpecificContentSettings::ClearMidiContentSettings() { |
midi_usages_state_.ClearStateMap(); |
} |
+/* |
+void TabSpecificContentSettings::ClearSensorContentSettings() { |
+ sensors_usages_state_.ClearStateMap(); |
+} |
+*/ |
+ |
void TabSpecificContentSettings::GeolocationDidNavigate( |
content::NavigationHandle* navigation_handle) { |
ContentSettingsUsagesState::CommittedDetails committed_details; |
@@ -891,6 +918,16 @@ void TabSpecificContentSettings::MidiDidNavigate( |
midi_usages_state_.DidNavigate(committed_details); |
} |
+/* |
+void TabSpecificContentSettings::SensorDidNavigate( |
+ content::NavigationHandle* navigation_handle) { |
+ ContentSettingsUsagesState::CommittedDetails committed_details; |
+ committed_details.current_url = navigation_handle->GetURL(); |
+ committed_details.previous_url = previous_url_; |
+ sensors_usages_state_.DidNavigate(committed_details); |
+} |
+*/ |
+ |
void TabSpecificContentSettings::BlockAllContentForTesting() { |
content_settings::ContentSettingsRegistry* registry = |
content_settings::ContentSettingsRegistry::GetInstance(); |