Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: chrome/browser/ui/webui/site_settings_helper.cc

Issue 2552883009: [MD settings] include source of policy for content settings (Closed)
Patch Set: account for unset source Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 GetPolicyAllowedUrls(type, &policy_exceptions, extension_registry, web_ui, 266 GetPolicyAllowedUrls(type, &policy_exceptions, extension_registry, web_ui,
267 incognito); 267 incognito);
268 } 268 }
269 269
270 for (auto& one_provider_exceptions : all_provider_exceptions) { 270 for (auto& one_provider_exceptions : all_provider_exceptions) {
271 for (auto& exception : one_provider_exceptions) 271 for (auto& exception : one_provider_exceptions)
272 exceptions->Append(std::move(exception)); 272 exceptions->Append(std::move(exception));
273 } 273 }
274 } 274 }
275 275
276 void GetContentCategorySetting(
277 const HostContentSettingsMap* map,
278 ContentSettingsType content_type,
279 base::DictionaryValue* object) {
280 std::string provider;
281 std::string setting = content_settings::ContentSettingToString(
282 map->GetDefaultContentSetting(content_type, &provider));
283 DCHECK(!setting.empty());
284
285 object->SetString(site_settings::kSetting, setting);
286 if (provider != "default")
287 object->SetString(site_settings::kSource, provider);
288 }
289
276 void GetPolicyAllowedUrls( 290 void GetPolicyAllowedUrls(
277 ContentSettingsType type, 291 ContentSettingsType type,
278 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions, 292 std::vector<std::unique_ptr<base::DictionaryValue>>* exceptions,
279 const extensions::ExtensionRegistry* extension_registry, 293 const extensions::ExtensionRegistry* extension_registry,
280 content::WebUI* web_ui, 294 content::WebUI* web_ui,
281 bool incognito) { 295 bool incognito) {
282 DCHECK(type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || 296 DCHECK(type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
283 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); 297 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
284 298
285 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs(); 299 PrefService* prefs = Profile::FromWebUI(web_ui)->GetPrefs();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 452 }
439 } 453 }
440 454
441 for (auto& one_provider_exceptions : all_provider_exceptions) { 455 for (auto& one_provider_exceptions : all_provider_exceptions) {
442 for (auto& exception : one_provider_exceptions) 456 for (auto& exception : one_provider_exceptions)
443 exceptions->Append(std::move(exception)); 457 exceptions->Append(std::move(exception));
444 } 458 }
445 } 459 }
446 460
447 } // namespace site_settings 461 } // namespace site_settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/site_settings_helper.h ('k') | chrome/test/data/webui/settings/site_settings_category_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698