| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/site_settings_handler.h" | 5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 217 } |
| 218 | 218 |
| 219 void SiteSettingsHandler::OnContentSettingChanged( | 219 void SiteSettingsHandler::OnContentSettingChanged( |
| 220 const ContentSettingsPattern& primary_pattern, | 220 const ContentSettingsPattern& primary_pattern, |
| 221 const ContentSettingsPattern& secondary_pattern, | 221 const ContentSettingsPattern& secondary_pattern, |
| 222 ContentSettingsType content_type, | 222 ContentSettingsType content_type, |
| 223 std::string resource_identifier) { | 223 std::string resource_identifier) { |
| 224 if (!site_settings::HasRegisteredGroupName(content_type)) | 224 if (!site_settings::HasRegisteredGroupName(content_type)) |
| 225 return; | 225 return; |
| 226 | 226 |
| 227 // These content types are deprecated and should not trigger a UI update. | |
| 228 // TODO(mgiuca): This is really only necessary to avoid breaking | |
| 229 // SiteSettingsHandlerTest.Incognito. Delete this check when we delete the | |
| 230 // enum value. https://crbug.com/591896 | |
| 231 if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN || | |
| 232 content_type == CONTENT_SETTINGS_TYPE_MOUSELOCK) { | |
| 233 return; | |
| 234 } | |
| 235 | |
| 236 if (primary_pattern.ToString().empty()) { | 227 if (primary_pattern.ToString().empty()) { |
| 237 CallJavascriptFunction( | 228 CallJavascriptFunction( |
| 238 "cr.webUIListenerCallback", | 229 "cr.webUIListenerCallback", |
| 239 base::StringValue("contentSettingCategoryChanged"), | 230 base::StringValue("contentSettingCategoryChanged"), |
| 240 base::StringValue(site_settings::ContentSettingsTypeToGroupName( | 231 base::StringValue(site_settings::ContentSettingsTypeToGroupName( |
| 241 content_type))); | 232 content_type))); |
| 242 } else { | 233 } else { |
| 243 CallJavascriptFunction( | 234 CallJavascriptFunction( |
| 244 "cr.webUIListenerCallback", | 235 "cr.webUIListenerCallback", |
| 245 base::StringValue("contentSettingSitePermissionChanged"), | 236 base::StringValue("contentSettingSitePermissionChanged"), |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 521 |
| 531 // A subset of the ContentSettingsType enum that we show in the settings UI. | 522 // A subset of the ContentSettingsType enum that we show in the settings UI. |
| 532 const ContentSettingsType kSettingsDetailTypes[] = { | 523 const ContentSettingsType kSettingsDetailTypes[] = { |
| 533 CONTENT_SETTINGS_TYPE_COOKIES, | 524 CONTENT_SETTINGS_TYPE_COOKIES, |
| 534 CONTENT_SETTINGS_TYPE_IMAGES, | 525 CONTENT_SETTINGS_TYPE_IMAGES, |
| 535 CONTENT_SETTINGS_TYPE_JAVASCRIPT, | 526 CONTENT_SETTINGS_TYPE_JAVASCRIPT, |
| 536 CONTENT_SETTINGS_TYPE_PLUGINS, | 527 CONTENT_SETTINGS_TYPE_PLUGINS, |
| 537 CONTENT_SETTINGS_TYPE_POPUPS, | 528 CONTENT_SETTINGS_TYPE_POPUPS, |
| 538 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 529 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 539 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 530 CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 540 CONTENT_SETTINGS_TYPE_FULLSCREEN, | |
| 541 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, | 531 CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, |
| 542 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, | 532 CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, |
| 543 CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, | 533 CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, |
| 544 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, | 534 CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, |
| 545 CONTENT_SETTINGS_TYPE_KEYGEN, | 535 CONTENT_SETTINGS_TYPE_KEYGEN, |
| 546 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, | 536 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
| 547 CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, | 537 CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, |
| 548 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, | 538 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, |
| 549 }; | 539 }; |
| 550 | 540 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 origin = content::kUnreachableWebDataURL; | 688 origin = content::kUnreachableWebDataURL; |
| 699 } | 689 } |
| 700 | 690 |
| 701 content::HostZoomMap* host_zoom_map; | 691 content::HostZoomMap* host_zoom_map; |
| 702 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); | 692 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); |
| 703 double default_level = host_zoom_map->GetDefaultZoomLevel(); | 693 double default_level = host_zoom_map->GetDefaultZoomLevel(); |
| 704 host_zoom_map->SetZoomLevelForHost(origin, default_level); | 694 host_zoom_map->SetZoomLevelForHost(origin, default_level); |
| 705 } | 695 } |
| 706 | 696 |
| 707 } // namespace settings | 697 } // namespace settings |
| OLD | NEW |