| Index: chrome/browser/content_settings/tab_specific_content_settings.cc
|
| ===================================================================
|
| --- chrome/browser/content_settings/tab_specific_content_settings.cc (revision 239622)
|
| +++ chrome/browser/content_settings/tab_specific_content_settings.cc (working copy)
|
| @@ -241,17 +241,7 @@
|
| }
|
| }
|
|
|
| -void TabSpecificContentSettings::AddBlockedResource(
|
| - ContentSettingsType content_type,
|
| - const std::string& resource_identifier) {
|
| - if (!blocked_resources_[content_type].get())
|
| - blocked_resources_[content_type].reset(new std::set<std::string>());
|
| - blocked_resources_[content_type]->insert(resource_identifier);
|
| -}
|
| -
|
| -void TabSpecificContentSettings::OnContentBlocked(
|
| - ContentSettingsType type,
|
| - const std::string& resource_identifier) {
|
| +void TabSpecificContentSettings::OnContentBlocked(ContentSettingsType type) {
|
| DCHECK(type != CONTENT_SETTINGS_TYPE_GEOLOCATION)
|
| << "Geolocation settings handled by OnGeolocationPermissionSet";
|
| if (type < 0 || type >= CONTENT_SETTINGS_NUM_TYPES)
|
| @@ -273,18 +263,6 @@
|
| break;
|
| }
|
|
|
| - // Unless UI for resource content settings is enabled, ignore the resource
|
| - // identifier.
|
| - // TODO(bauerb): The UI to unblock content should be disabled if the content
|
| - // setting was not set by the user.
|
| - std::string identifier;
|
| - if (CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kEnableResourceContentSettings)) {
|
| - identifier = resource_identifier;
|
| - }
|
| - if (!identifier.empty())
|
| - AddBlockedResource(type, identifier);
|
| -
|
| #if defined(OS_ANDROID)
|
| if (type == CONTENT_SETTINGS_TYPE_POPUPS) {
|
| // For Android we do not have a persistent button that will always be
|
| @@ -350,7 +328,7 @@
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.cookies()->AddReadCookies(
|
| frame_url, url, cookie_list);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.cookies()->AddReadCookies(
|
| frame_url, url, cookie_list);
|
| @@ -369,7 +347,7 @@
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.cookies()->AddChangedCookie(
|
| frame_url, url, cookie_line, options);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.cookies()->AddChangedCookie(
|
| frame_url, url, cookie_line, options);
|
| @@ -386,7 +364,7 @@
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.indexed_dbs()->AddIndexedDB(
|
| url, description);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.indexed_dbs()->AddIndexedDB(
|
| url, description);
|
| @@ -407,7 +385,7 @@
|
| helper->AddLocalStorage(url);
|
|
|
| if (blocked_by_policy)
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| else
|
| OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES);
|
|
|
| @@ -422,7 +400,7 @@
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.databases()->AddDatabase(
|
| url, UTF16ToUTF8(name), UTF16ToUTF8(display_name));
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.databases()->AddDatabase(
|
| url, UTF16ToUTF8(name), UTF16ToUTF8(display_name));
|
| @@ -438,7 +416,7 @@
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.file_systems()->AddFileSystem(url,
|
| fileapi::kFileSystemTypeTemporary, 0);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.file_systems()->AddFileSystem(url,
|
| fileapi::kFileSystemTypeTemporary, 0);
|
| @@ -465,8 +443,7 @@
|
| if (allowed) {
|
| OnContentAllowed(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER);
|
| } else {
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
|
| - std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER);
|
| }
|
| }
|
| #endif
|
| @@ -515,8 +492,7 @@
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_POLICY:
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_USER_SETTING:
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_USER:
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
|
| - std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
|
| break;
|
| }
|
| }
|
| @@ -535,8 +511,7 @@
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_POLICY:
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_USER_SETTING:
|
| case MediaStreamDevicesController::MEDIA_BLOCKED_BY_USER:
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
|
| - std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
|
| break;
|
| }
|
| }
|
| @@ -551,7 +526,7 @@
|
| void TabSpecificContentSettings::OnMIDISysExAccessBlocked(
|
| const GURL& requesting_origin) {
|
| midi_usages_state_.OnPermissionSet(requesting_origin, false);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_MIDI_SYSEX, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_MIDI_SYSEX);
|
| }
|
|
|
| void TabSpecificContentSettings::ClearBlockedContentSettingsExceptForCookies() {
|
| @@ -624,7 +599,7 @@
|
| if (allowed) {
|
| OnContentAllowed(CONTENT_SETTINGS_TYPE_PPAPI_BROKER);
|
| } else {
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_PPAPI_BROKER);
|
| }
|
| }
|
|
|
| @@ -682,7 +657,7 @@
|
| bool blocked_by_policy) {
|
| if (blocked_by_policy) {
|
| blocked_local_shared_objects_.appcaches()->AddAppCache(manifest_url);
|
| - OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES, std::string());
|
| + OnContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES);
|
| } else {
|
| allowed_local_shared_objects_.appcaches()->AddAppCache(manifest_url);
|
| OnContentAllowed(CONTENT_SETTINGS_TYPE_COOKIES);
|
|
|