Chromium Code Reviews| 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/site_settings_helper.h" | 5 #include "chrome/browser/ui/webui/site_settings_helper.h" |
| 6 | 6 |
| 7 #include <functional> | 7 #include <functional> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 DCHECK(policy_exceptions.empty()); | 237 DCHECK(policy_exceptions.empty()); |
| 238 GetPolicyAllowedUrls(type, &policy_exceptions, web_ui, incognito); | 238 GetPolicyAllowedUrls(type, &policy_exceptions, web_ui, incognito); |
| 239 } | 239 } |
| 240 | 240 |
| 241 for (auto& one_provider_exceptions : all_provider_exceptions) { | 241 for (auto& one_provider_exceptions : all_provider_exceptions) { |
| 242 for (auto& exception : one_provider_exceptions) | 242 for (auto& exception : one_provider_exceptions) |
| 243 exceptions->Append(std::move(exception)); | 243 exceptions->Append(std::move(exception)); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 void GetContentCategorySetting( | |
| 248 const HostContentSettingsMap* map, | |
| 249 ContentSettingsType content_type, | |
| 250 base::DictionaryValue* object) { | |
| 251 std::string provider; | |
| 252 std::string setting = content_settings::ContentSettingToString( | |
| 253 map->GetDefaultContentSetting(content_type, &provider)); | |
| 254 DCHECK(!setting.empty()); | |
| 255 | |
| 256 object->SetString(site_settings::kSetting, setting); | |
| 257 object->SetString(site_settings::kSource, provider); | |
|
Dan Beam
2016/11/21 21:48:46
can we just set this only when provider != default
dschuyler
2016/11/22 02:28:50
Is that to reduce the size of the IPC call? There
Dan Beam
2016/11/22 02:57:40
no
dschuyler
2016/11/24 01:25:48
Done.
| |
| 258 } | |
| 259 | |
| 247 void GetPolicyAllowedUrls( | 260 void GetPolicyAllowedUrls( |
| 248 ContentSettingsType type, | 261 ContentSettingsType type, |
| 249 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, | 262 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, |
| 250 content::WebUI* web_ui, | 263 content::WebUI* web_ui, |
| 251 bool incognito) { | 264 bool incognito) { |
| 252 DCHECK(type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 265 DCHECK(type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
| 253 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); | 266 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); |
| 254 | 267 |
| 255 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); | 268 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); |
| 256 const base::ListValue* policy_urls = prefs->GetList( | 269 const base::ListValue* policy_urls = prefs->GetList( |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 } | 420 } |
| 408 } | 421 } |
| 409 | 422 |
| 410 for (auto& one_provider_exceptions : all_provider_exceptions) { | 423 for (auto& one_provider_exceptions : all_provider_exceptions) { |
| 411 for (auto& exception : one_provider_exceptions) | 424 for (auto& exception : one_provider_exceptions) |
| 412 exceptions->Append(std::move(exception)); | 425 exceptions->Append(std::move(exception)); |
| 413 } | 426 } |
| 414 } | 427 } |
| 415 | 428 |
| 416 } // namespace site_settings | 429 } // namespace site_settings |
| OLD | NEW |