| 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 |
| 227 if (primary_pattern.ToString().empty()) { | 236 if (primary_pattern.ToString().empty()) { |
| 228 CallJavascriptFunction( | 237 CallJavascriptFunction( |
| 229 "cr.webUIListenerCallback", | 238 "cr.webUIListenerCallback", |
| 230 base::StringValue("contentSettingCategoryChanged"), | 239 base::StringValue("contentSettingCategoryChanged"), |
| 231 base::StringValue(site_settings::ContentSettingsTypeToGroupName( | 240 base::StringValue(site_settings::ContentSettingsTypeToGroupName( |
| 232 content_type))); | 241 content_type))); |
| 233 } else { | 242 } else { |
| 234 CallJavascriptFunction( | 243 CallJavascriptFunction( |
| 235 "cr.webUIListenerCallback", | 244 "cr.webUIListenerCallback", |
| 236 base::StringValue("contentSettingSitePermissionChanged"), | 245 base::StringValue("contentSettingSitePermissionChanged"), |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 origin = content::kUnreachableWebDataURL; | 698 origin = content::kUnreachableWebDataURL; |
| 690 } | 699 } |
| 691 | 700 |
| 692 content::HostZoomMap* host_zoom_map; | 701 content::HostZoomMap* host_zoom_map; |
| 693 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); | 702 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); |
| 694 double default_level = host_zoom_map->GetDefaultZoomLevel(); | 703 double default_level = host_zoom_map->GetDefaultZoomLevel(); |
| 695 host_zoom_map->SetZoomLevelForHost(origin, default_level); | 704 host_zoom_map->SetZoomLevelForHost(origin, default_level); |
| 696 } | 705 } |
| 697 | 706 |
| 698 } // namespace settings | 707 } // namespace settings |
| OLD | NEW |