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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2165733003: Add revocation reporter to permission util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-ui-to-permission-report
Patch Set: Add missing return Created 4 years, 5 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
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index bfd711a8d0e036d125082fc931d49a5f7ec52133..4b10016c43e0b7e1627656029d274e6425b8de04 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
+#include "chrome/browser/permissions/permission_uma_util.h"
#include "chrome/browser/permissions/permission_util.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile.h"
@@ -730,13 +731,23 @@ void ContentSettingMediaStreamBubbleModel::UpdateSettings(
// order to override the existing rule. Otherwise a new rule is created.
// TODO(markusheintz): Extract to a helper so that there is only a single
// place to touch.
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile());
if (MicrophoneAccessed()) {
- PermissionUtil::SetContentSettingAndRecordRevocation(profile(),
+ PermissionUtil::RevocationReporter scoped_revocation_reporter(
+ profile(), tab_content_settings->media_stream_access_origin(), GURL(),
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string(),
+ PermissionSourceUI::PAGE_ACTION);
+ map->SetContentSettingDefaultScope(
tab_content_settings->media_stream_access_origin(), GURL(),
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, std::string(), setting);
}
if (CameraAccessed()) {
- PermissionUtil::SetContentSettingAndRecordRevocation(profile(),
+ PermissionUtil::RevocationReporter scoped_revocation_reporter(
+ profile(), tab_content_settings->media_stream_access_origin(), GURL(),
+ CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string(),
+ PermissionSourceUI::PAGE_ACTION);
+ map->SetContentSettingDefaultScope(
tab_content_settings->media_stream_access_origin(), GURL(),
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, std::string(), setting);
}
@@ -940,11 +951,16 @@ void ContentSettingDomainListBubbleModel::OnCustomLinkClicked() {
TabSpecificContentSettings::FromWebContents(web_contents());
const ContentSettingsUsagesState::StateMap& state_map =
content_settings->geolocation_usages_state().state_map();
-
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile());
for (const std::pair<GURL, ContentSetting>& map_entry : state_map) {
- PermissionUtil::SetContentSettingAndRecordRevocation(profile(),
- map_entry.first, embedder_url, CONTENT_SETTINGS_TYPE_GEOLOCATION,
- std::string(), CONTENT_SETTING_DEFAULT);
+ PermissionUtil::RevocationReporter(profile(), map_entry.first, embedder_url,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(),
raymes 2016/07/21 23:08:01 Will the resource_identifier argument be used in a
stefanocs 2016/07/22 00:44:28 Done. Probably not, so I am removing this for now.
+ PermissionSourceUI::PAGE_ACTION);
+ map->SetContentSettingDefaultScope(map_entry.first, embedder_url,
+ CONTENT_SETTINGS_TYPE_GEOLOCATION,
+ std::string(), CONTENT_SETTING_DEFAULT);
}
}
@@ -1213,12 +1229,16 @@ void ContentSettingMidiSysExBubbleModel::OnCustomLinkClicked() {
TabSpecificContentSettings::FromWebContents(web_contents());
const ContentSettingsUsagesState::StateMap& state_map =
content_settings->midi_usages_state().state_map();
-
+ HostContentSettingsMap* map =
+ HostContentSettingsMapFactory::GetForProfile(profile());
for (const std::pair<GURL, ContentSetting>& map_entry : state_map) {
- PermissionUtil::SetContentSettingAndRecordRevocation(
- profile(), map_entry.first, embedder_url,
- CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string(),
- CONTENT_SETTING_DEFAULT);
+ PermissionUtil::RevocationReporter(profile(), map_entry.first, embedder_url,
+ CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
+ std::string(),
+ PermissionSourceUI::PAGE_ACTION);
+ map->SetContentSettingDefaultScope(map_entry.first, embedder_url,
+ CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
+ std::string(), CONTENT_SETTING_DEFAULT);
}
}

Powered by Google App Engine
This is Rietveld 408576698