Commit 619d83e2 authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

SplitSettings: Cleanup extension APIs permissions

Some permissions are only needed by one of chrome://settings or
chrome://os-settings but not both.

Specifically, with this CL the following APIs are only accessible
by chrome://os-settings

 - chrome.bluetooth
 - chrome.bluetoothPrivate
 - chrome.networkingPrivate
 - chrome.system.display
 - chrome.usersPrivate

while the following only accessible by chrome://settings

 - chrome.autofillPrivate
 - chrome.management
 - chrome.passwordsPrivate

Bug: 990177
Change-Id: Id40dbcd1cf92eaf7227744c9b38267cc786c1476
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1990027Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729557}
parent 491f182e
...@@ -107,9 +107,6 @@ ...@@ -107,9 +107,6 @@
"channel": "stable", "channel": "stable",
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*" "chrome://settings/*"
] ]
}], }],
...@@ -631,9 +628,6 @@ ...@@ -631,9 +628,6 @@
"channel": "stable", "channel": "stable",
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*" "chrome://settings/*"
] ]
}], }],
...@@ -687,8 +681,6 @@ ...@@ -687,8 +681,6 @@
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
"chrome://multidevice-setup/*", "chrome://multidevice-setup/*",
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*", "chrome://os-settings/*",
"chrome://settings/*", "chrome://settings/*",
"chrome://oobe/*" "chrome://oobe/*"
...@@ -724,8 +716,6 @@ ...@@ -724,8 +716,6 @@
"channel": "stable", "channel": "stable",
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*", "chrome://os-settings/*",
"chrome://settings/*" "chrome://settings/*"
] ]
...@@ -792,10 +782,7 @@ ...@@ -792,10 +782,7 @@
"channel": "stable", "channel": "stable",
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
// TODO(maybelle): Audit and remove chrome://settings or "chrome://os-settings/*"
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*"
] ]
}], }],
"virtualKeyboardPrivate": { "virtualKeyboardPrivate": {
......
...@@ -479,7 +479,7 @@ TEST_F(NetworkingPrivateApiTest, SetNetworkRestrictedPropertiesFromWebUI) { ...@@ -479,7 +479,7 @@ TEST_F(NetworkingPrivateApiTest, SetNetworkRestrictedPropertiesFromWebUI) {
scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties = scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties =
new NetworkingPrivateSetPropertiesFunction(); new NetworkingPrivateSetPropertiesFunction();
set_properties->set_source_context_type(Feature::WEBUI_CONTEXT); set_properties->set_source_context_type(Feature::WEBUI_CONTEXT);
set_properties->set_source_url(GURL("chrome://settings/networkDetail")); set_properties->set_source_url(GURL("chrome://os-settings/networkDetail"));
const char kCombinedSettings[] = const char kCombinedSettings[] =
R"({ R"({
...@@ -676,7 +676,7 @@ TEST_F(NetworkingPrivateApiTest, CreateL2TPVpnFromWebUi) { ...@@ -676,7 +676,7 @@ TEST_F(NetworkingPrivateApiTest, CreateL2TPVpnFromWebUi) {
scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network = scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network =
new NetworkingPrivateCreateNetworkFunction(); new NetworkingPrivateCreateNetworkFunction();
create_network->set_source_context_type(Feature::WEBUI_CONTEXT); create_network->set_source_context_type(Feature::WEBUI_CONTEXT);
create_network->set_source_url(GURL("chrome://settings/networkDetail")); create_network->set_source_url(GURL("chrome://os-settings/networkDetail"));
std::unique_ptr<base::Value> result = RunFunctionAndReturnValue( std::unique_ptr<base::Value> result = RunFunctionAndReturnValue(
create_network.get(), create_network.get(),
base::StringPrintf("[false, %s]", kL2tpIpsecConfig)); base::StringPrintf("[false, %s]", kL2tpIpsecConfig));
...@@ -708,7 +708,7 @@ TEST_F(NetworkingPrivateApiTest, CreateL2TPVpnFromWebUi) { ...@@ -708,7 +708,7 @@ TEST_F(NetworkingPrivateApiTest, CreateL2TPVpnFromWebUi) {
scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties = scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties =
new NetworkingPrivateSetPropertiesFunction(); new NetworkingPrivateSetPropertiesFunction();
set_properties->set_source_context_type(Feature::WEBUI_CONTEXT); set_properties->set_source_context_type(Feature::WEBUI_CONTEXT);
set_properties->set_source_url(GURL("chrome://settings/networkDetail")); set_properties->set_source_url(GURL("chrome://os-settings/networkDetail"));
result = RunFunctionAndReturnValue( result = RunFunctionAndReturnValue(
set_properties.get(), set_properties.get(),
base::StringPrintf( base::StringPrintf(
...@@ -736,7 +736,7 @@ TEST_F(NetworkingPrivateApiTest, CreateOpenVpnFromWebUiAndSetProperties) { ...@@ -736,7 +736,7 @@ TEST_F(NetworkingPrivateApiTest, CreateOpenVpnFromWebUiAndSetProperties) {
scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network = scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network =
new NetworkingPrivateCreateNetworkFunction(); new NetworkingPrivateCreateNetworkFunction();
create_network->set_source_context_type(Feature::WEBUI_CONTEXT); create_network->set_source_context_type(Feature::WEBUI_CONTEXT);
create_network->set_source_url(GURL("chrome://settings/networkDetail")); create_network->set_source_url(GURL("chrome://os-settings/networkDetail"));
std::unique_ptr<base::Value> result = RunFunctionAndReturnValue( std::unique_ptr<base::Value> result = RunFunctionAndReturnValue(
create_network.get(), base::StringPrintf("[false, %s]", kOpenVpnConfig)); create_network.get(), base::StringPrintf("[false, %s]", kOpenVpnConfig));
...@@ -768,7 +768,7 @@ TEST_F(NetworkingPrivateApiTest, CreateOpenVpnFromWebUiAndSetProperties) { ...@@ -768,7 +768,7 @@ TEST_F(NetworkingPrivateApiTest, CreateOpenVpnFromWebUiAndSetProperties) {
scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties = scoped_refptr<NetworkingPrivateSetPropertiesFunction> set_properties =
new NetworkingPrivateSetPropertiesFunction(); new NetworkingPrivateSetPropertiesFunction();
set_properties->set_source_context_type(Feature::WEBUI_CONTEXT); set_properties->set_source_context_type(Feature::WEBUI_CONTEXT);
set_properties->set_source_url(GURL("chrome://settings/networkDetail")); set_properties->set_source_url(GURL("chrome://os-settings/networkDetail"));
result = RunFunctionAndReturnValue( result = RunFunctionAndReturnValue(
set_properties.get(), set_properties.get(),
base::StringPrintf( base::StringPrintf(
...@@ -887,7 +887,7 @@ TEST_F(NetworkingPrivateApiTest, ...@@ -887,7 +887,7 @@ TEST_F(NetworkingPrivateApiTest,
scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network = scoped_refptr<NetworkingPrivateCreateNetworkFunction> create_network =
new NetworkingPrivateCreateNetworkFunction(); new NetworkingPrivateCreateNetworkFunction();
create_network->set_source_context_type(Feature::WEBUI_CONTEXT); create_network->set_source_context_type(Feature::WEBUI_CONTEXT);
create_network->set_source_url(GURL("chrome://settings/networkDetail")); create_network->set_source_url(GURL("chrome://os-settings/networkDetail"));
std::unique_ptr<base::Value> result = RunFunctionAndReturnValue( std::unique_ptr<base::Value> result = RunFunctionAndReturnValue(
create_network.get(), base::StringPrintf("[false, %s]", kNetworkConfig)); create_network.get(), base::StringPrintf("[false, %s]", kNetworkConfig));
ASSERT_TRUE(result); ASSERT_TRUE(result);
...@@ -1112,7 +1112,7 @@ TEST_F(NetworkingPrivateApiTest, GetCellularPropertiesFromWebUi) { ...@@ -1112,7 +1112,7 @@ TEST_F(NetworkingPrivateApiTest, GetCellularPropertiesFromWebUi) {
scoped_refptr<NetworkingPrivateGetPropertiesFunction> get_properties = scoped_refptr<NetworkingPrivateGetPropertiesFunction> get_properties =
new NetworkingPrivateGetPropertiesFunction(); new NetworkingPrivateGetPropertiesFunction();
get_properties->set_source_context_type(Feature::WEBUI_CONTEXT); get_properties->set_source_context_type(Feature::WEBUI_CONTEXT);
get_properties->set_source_url(GURL("chrome://settings/networkDetail")); get_properties->set_source_url(GURL("chrome://os-settings/networkDetail"));
std::unique_ptr<base::Value> result = RunFunctionAndReturnValue( std::unique_ptr<base::Value> result = RunFunctionAndReturnValue(
get_properties.get(), base::StringPrintf(R"(["%s"])", kCellularGuid)); get_properties.get(), base::StringPrintf(R"(["%s"])", kCellularGuid));
......
...@@ -99,10 +99,7 @@ ...@@ -99,10 +99,7 @@
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
"chrome://bluetooth-pairing/*", "chrome://bluetooth-pairing/*",
// TODO(maybelle): Audit and remove chrome://settings or "chrome://os-settings/*"
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*"
] ]
}], }],
"bluetoothLowEnergy": { "bluetoothLowEnergy": {
...@@ -118,10 +115,7 @@ ...@@ -118,10 +115,7 @@
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
"chrome://bluetooth-pairing/*", "chrome://bluetooth-pairing/*",
// TODO(maybelle): Audit and remove chrome://settings or "chrome://os-settings/*"
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*"
] ]
}], }],
"bluetoothSocket": { "bluetoothSocket": {
...@@ -269,9 +263,6 @@ ...@@ -269,9 +263,6 @@
"matches": [ "matches": [
"chrome://extensions/*", "chrome://extensions/*",
"chrome://extensions-frame/*", // TODO(dbeam): still needed? "chrome://extensions-frame/*", // TODO(dbeam): still needed?
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*" "chrome://settings/*"
] ]
}], }],
...@@ -320,8 +311,6 @@ ...@@ -320,8 +311,6 @@
"matches": [ "matches": [
"chrome://bookmarks/*", "chrome://bookmarks/*",
"chrome://extensions/*", "chrome://extensions/*",
// TODO(maybelle): Audit and remove chrome://settings or
// chrome://os-settings as appropriate
"chrome://os-settings/*", "chrome://os-settings/*",
"chrome://settings/*", "chrome://settings/*",
"chrome://sync-confirmation/*", "chrome://sync-confirmation/*",
...@@ -404,10 +393,7 @@ ...@@ -404,10 +393,7 @@
"chrome://oobe/*", "chrome://oobe/*",
"chrome://internet-config-dialog/*", "chrome://internet-config-dialog/*",
"chrome://internet-detail-dialog/*", "chrome://internet-detail-dialog/*",
// TODO(maybelle): Audit and remove chrome://settings or "chrome://os-settings/*"
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*"
] ]
}], }],
"power": { "power": {
...@@ -558,10 +544,7 @@ ...@@ -558,10 +544,7 @@
"channel": "stable", "channel": "stable",
"contexts": ["webui"], "contexts": ["webui"],
"matches": [ "matches": [
// TODO(maybelle): Audit and remove chrome://settings or "chrome://os-settings/*"
// chrome://os-settings as appropriate
"chrome://os-settings/*",
"chrome://settings/*"
] ]
}], }],
"system.memory": { "system.memory": {
......
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