Commit 9579c164 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Add EditBookmarksEnabled enterprise policy handler

EditBookmarksEnabled is an enterprise policy that determines whether
the user can edit any bookmarks. The policy is mapped to a user pref.

This CL is part of a series of CLs that add support for this
enterprise policy on the iOS platform.

This CL:
- Turns on iOS support for EditBookmarksEnabled.
- Adds EditBookmarksEnabled to basic policy handler policy map.
- Adds basic test via json test cases.

Bug: 1072326
Change-Id: I1b03db4ee2d808bf5c4c7bbe039cf3346d98c9b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2156138
Commit-Queue: edchin <edchin@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760600}
parent 6af35cf7
......@@ -6738,7 +6738,12 @@
'owners': ['file://components/policy/resources/OWNERS'],
'type': 'main',
'schema': { 'type': 'boolean' },
'supported_on': ['chrome.*:12-', 'chrome_os:12-', 'android:30-'],
'supported_on': [
'chrome.*:12-',
'chrome_os:12-',
'android:30-',
'ios:83-'
],
'features': {
'dynamic_refresh': True,
'per_profile': True,
......
......@@ -21,6 +21,7 @@ source_set("policy") {
deps = [
"//base",
"//components/autofill/core/browser",
"//components/bookmarks/common",
"//components/bookmarks/managed",
"//components/password_manager/core/common",
"//components/policy:generated",
......
......@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "components/autofill/core/browser/autofill_credit_card_policy_handler.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/bookmarks/managed/managed_bookmarks_policy_handler.h"
#include "components/password_manager/core/common/password_manager_pref_names.h"
#include "components/policy/core/browser/configuration_policy_handler.h"
......@@ -29,6 +30,9 @@ namespace {
// that directly map to a single preference.
// clang-format off
const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
{ policy::key::kEditBookmarksEnabled,
bookmarks::prefs::kEditBookmarksEnabled,
base::Value::Type::BOOLEAN },
{ policy::key::kPasswordManagerEnabled,
password_manager::prefs::kCredentialsEnableService,
base::Value::Type::BOOLEAN },
......
......@@ -35,6 +35,16 @@
]
},
"EditBookmarksEnabled": {
"os": [ "ios" ],
"policy_pref_mapping_test": [
{
"policies": { "EditBookmarksEnabled": false },
"prefs": { "bookmarks.editing_enabled": {} }
}
]
},
"PasswordManagerEnabled": {
"os": [ "ios" ],
"can_be_recommended": true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment