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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 CHECK_EQ(2U, args->GetSize()); | 192 CHECK_EQ(2U, args->GetSize()); |
193 const base::Value* callback_id; | 193 const base::Value* callback_id; |
194 CHECK(args->Get(0, &callback_id)); | 194 CHECK(args->Get(0, &callback_id)); |
195 double type; | 195 double type; |
196 CHECK(args->GetDouble(1, &type)); | 196 CHECK(args->GetDouble(1, &type)); |
197 ContentSettingsType content_type = | 197 ContentSettingsType content_type = |
198 static_cast<ContentSettingsType>(static_cast<int>(type)); | 198 static_cast<ContentSettingsType>(static_cast<int>(type)); |
199 | 199 |
200 HostContentSettingsMap* map = | 200 HostContentSettingsMap* map = |
201 HostContentSettingsMapFactory::GetForProfile(profile_); | 201 HostContentSettingsMapFactory::GetForProfile(profile_); |
202 scoped_ptr<base::ListValue> exceptions(new base::ListValue); | 202 std::unique_ptr<base::ListValue> exceptions(new base::ListValue); |
203 site_settings::GetExceptionsFromHostContentSettingsMap( | 203 site_settings::GetExceptionsFromHostContentSettingsMap( |
204 map, content_type, web_ui(), exceptions.get()); | 204 map, content_type, web_ui(), exceptions.get()); |
205 ResolveJavascriptCallback(*callback_id, *exceptions.get()); | 205 ResolveJavascriptCallback(*callback_id, *exceptions.get()); |
206 } | 206 } |
207 | 207 |
208 void SiteSettingsHandler::HandleResetCategoryPermissionForOrigin( | 208 void SiteSettingsHandler::HandleResetCategoryPermissionForOrigin( |
209 const base::ListValue* args) { | 209 const base::ListValue* args) { |
210 CHECK_EQ(3U, args->GetSize()); | 210 CHECK_EQ(3U, args->GetSize()); |
211 std::string primary_pattern; | 211 std::string primary_pattern; |
212 CHECK(args->GetString(0, &primary_pattern)); | 212 CHECK(args->GetString(0, &primary_pattern)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 HostContentSettingsMapFactory::GetForProfile(profile_); | 248 HostContentSettingsMapFactory::GetForProfile(profile_); |
249 map->SetContentSettingCustomScope( | 249 map->SetContentSettingCustomScope( |
250 ContentSettingsPattern::FromString(primary_pattern), | 250 ContentSettingsPattern::FromString(primary_pattern), |
251 secondary_pattern.empty() ? | 251 secondary_pattern.empty() ? |
252 ContentSettingsPattern::Wildcard() : | 252 ContentSettingsPattern::Wildcard() : |
253 ContentSettingsPattern::FromString(secondary_pattern), | 253 ContentSettingsPattern::FromString(secondary_pattern), |
254 content_type, "", setting); | 254 content_type, "", setting); |
255 } | 255 } |
256 | 256 |
257 } // namespace settings | 257 } // namespace settings |
OLD | NEW |