| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 CHECK(args->Get(0, &callback_id)); | 391 CHECK(args->Get(0, &callback_id)); |
| 392 std::string type; | 392 std::string type; |
| 393 CHECK(args->GetString(1, &type)); | 393 CHECK(args->GetString(1, &type)); |
| 394 | 394 |
| 395 ContentSettingsType content_type = | 395 ContentSettingsType content_type = |
| 396 static_cast<ContentSettingsType>(static_cast<int>( | 396 static_cast<ContentSettingsType>(static_cast<int>( |
| 397 site_settings::ContentSettingsTypeFromGroupName(type))); | 397 site_settings::ContentSettingsTypeFromGroupName(type))); |
| 398 HostContentSettingsMap* map = | 398 HostContentSettingsMap* map = |
| 399 HostContentSettingsMapFactory::GetForProfile(profile_); | 399 HostContentSettingsMapFactory::GetForProfile(profile_); |
| 400 | 400 |
| 401 std::string setting = content_settings::ContentSettingToString( | 401 base::DictionaryValue category; |
| 402 map->GetDefaultContentSetting(content_type, nullptr)); | 402 site_settings::GetContentCategorySetting(map, content_type, &category); |
| 403 ResolveJavascriptCallback(*callback_id, base::StringValue(setting)); | 403 ResolveJavascriptCallback(*callback_id, category); |
| 404 } | 404 } |
| 405 | 405 |
| 406 void SiteSettingsHandler::HandleGetExceptionList(const base::ListValue* args) { | 406 void SiteSettingsHandler::HandleGetExceptionList(const base::ListValue* args) { |
| 407 AllowJavascript(); | 407 AllowJavascript(); |
| 408 | 408 |
| 409 CHECK_EQ(2U, args->GetSize()); | 409 CHECK_EQ(2U, args->GetSize()); |
| 410 const base::Value* callback_id; | 410 const base::Value* callback_id; |
| 411 CHECK(args->Get(0, &callback_id)); | 411 CHECK(args->Get(0, &callback_id)); |
| 412 std::string type; | 412 std::string type; |
| 413 CHECK(args->GetString(1, &type)); | 413 CHECK(args->GetString(1, &type)); |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 origin = content::kUnreachableWebDataURL; | 709 origin = content::kUnreachableWebDataURL; |
| 710 } | 710 } |
| 711 | 711 |
| 712 content::HostZoomMap* host_zoom_map; | 712 content::HostZoomMap* host_zoom_map; |
| 713 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); | 713 host_zoom_map = content::HostZoomMap::GetDefaultForBrowserContext(profile_); |
| 714 double default_level = host_zoom_map->GetDefaultZoomLevel(); | 714 double default_level = host_zoom_map->GetDefaultZoomLevel(); |
| 715 host_zoom_map->SetZoomLevelForHost(origin, default_level); | 715 host_zoom_map->SetZoomLevelForHost(origin, default_level); |
| 716 } | 716 } |
| 717 | 717 |
| 718 } // namespace settings | 718 } // namespace settings |
| OLD | NEW |