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

Unified Diff: chrome/browser/permissions/permission_util.cc

Issue 2936003003: MD Settings: Set all content setting values in Site Details Javascript. (Closed)
Patch Set: Review comments, tests & cleanup. Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/permissions/permission_util.cc
diff --git a/chrome/browser/permissions/permission_util.cc b/chrome/browser/permissions/permission_util.cc
index 1dc6cc6c63743c9e1c41d7042a6a1af027733d19..d3b90f3119ca3c21af328246abc3dc10f9ffde0d 100644
--- a/chrome/browser/permissions/permission_util.cc
+++ b/chrome/browser/permissions/permission_util.cc
@@ -4,10 +4,11 @@
#include "chrome/browser/permissions/permission_util.h"
-#include "build/build_config.h"
#include "base/feature_list.h"
#include "base/logging.h"
+#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
+#include "chrome/browser/permissions/permission_result.h"
#include "chrome/browser/permissions/permission_uma_util.h"
#include "chrome/common/chrome_features.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -161,6 +162,24 @@ bool PermissionUtil::IsPermission(ContentSettingsType type) {
}
}
+PermissionStatusSource
+PermissionUtil::ConvertSettingSourceToPermissionStatusSource(
+ content_settings::SettingSource source) {
+ switch (source) {
+ case content_settings::SETTING_SOURCE_NONE:
+ case content_settings::SETTING_SOURCE_WHITELIST:
+ case content_settings::SETTING_SOURCE_SUPERVISED:
+ case content_settings::SETTING_SOURCE_USER:
+ break;
+
+ case content_settings::SETTING_SOURCE_POLICY:
+ return PermissionStatusSource::ENTERPRISE_POLICY;
+ case content_settings::SETTING_SOURCE_EXTENSION:
+ return PermissionStatusSource::EXTENSION;
+ }
+ return PermissionStatusSource::UNSPECIFIED;
+}
+
bool PermissionUtil::ShouldShowPersistenceToggle(ContentSettingsType type) {
return (type == CONTENT_SETTINGS_TYPE_GEOLOCATION ||
type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||

Powered by Google App Engine
This is Rietveld 408576698