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

Issue 2479973002: MD Settings: clarify "controlled by" logic (Closed)

Created:
4 years, 1 month ago by Dan Beam
Modified:
3 years, 10 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MD Settings: clarify "controlled by" logic Before, we were using PrefService::Preference::IsExtensionControlled() to determine if a pref was controlled by an extension. But, as far as I can tell, that determines if a pref was *registered* by an extension. What we want to know is whether an extension was installed (either by a user or by policy) that overrides a function pref value. I re-used the same code that /options/ used, which is a complicated mixture of enums, manifest sniffing, and pref filtering. But it works. I've added a small shim to re-use that from settings, based on pref name. It's not amazing, but it'll work for now. What next? Well, this turns off extension puzzle piece icons and tooltips. This CL also plumbs more information about whether an extension can be disabled (a major shortcoming of the old UI, as disable buttons don't work in some cases). Next step: show a separate row-like UI. See crbug.com/614265#c36. R=stevenjb@chromium.org BUG=614265 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/455f3cce3da21f8e677100b0c0abd8d35e24876e Cr-Commit-Position: refs/heads/master@{#432704}

Patch Set 1 : nits #

Total comments: 1

Patch Set 2 : . #

Patch Set 3 : update externs #

Total comments: 8

Patch Set 4 : comment #

Patch Set 5 : exclude associated prefs #

Patch Set 6 : merge #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+170 lines, -155 lines) Patch
M chrome/browser/extensions/api/settings_private/prefs_util.h View 1 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/settings_private/prefs_util.cc View 1 2 3 4 5 10 chunks +68 lines, -50 lines 1 comment Download
M chrome/browser/extensions/settings_api_helpers.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/extensions/settings_api_helpers.cc View 1 2 chunks +17 lines, -0 lines 0 comments Download
M chrome/browser/resources/settings/controls/controlled_button.js View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/controls/settings_checkbox.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/controls/settings_input.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/controls/settings_toggle_button.html View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/settings/date_time_page/date_time_page.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/options/browser_options_handler.cc View 1 2 3 4 5 7 chunks +15 lines, -38 lines 0 comments Download
M chrome/browser/ui/webui/policy_indicator_localized_strings_provider.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/settings_private.idl View 1 3 chunks +14 lines, -17 lines 0 comments Download
M chrome/test/data/webui/settings/controlled_button_tests.js View 1 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/test/data/webui/settings/controlled_radio_button_tests.js View 1 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/closure_compiler/externs/settings_private.js View 1 2 5 chunks +13 lines, -11 lines 0 comments Download
M third_party/closure_compiler/interfaces/settings_private_interface.js View 1 1 chunk +4 lines, -2 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js View 1 4 chunks +1 line, -7 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js View 1 1 chunk +14 lines, -16 lines 0 comments Download
M ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js View 1 2 chunks +2 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 54 (34 generated)
Dan Beam
so, the code works for me locally (at least for proxy) any sane recommendations on ...
4 years, 1 month ago (2016-11-05 01:12:42 UTC) #3
stevenjb
https://codereview.chromium.org/2479973002/diff/40001/chrome/common/extensions/api/settings_private.idl File chrome/common/extensions/api/settings_private.idl (right): https://codereview.chromium.org/2479973002/diff/40001/chrome/common/extensions/api/settings_private.idl#newcode19 chrome/common/extensions/api/settings_private.idl:19: // could rename "PolicySource" to "ControlledBy" or "EnforcementSource"? First ...
4 years, 1 month ago (2016-11-09 18:03:30 UTC) #4
stevenjb
On 2016/11/09 18:03:30, stevenjb wrote: > https://codereview.chromium.org/2479973002/diff/40001/chrome/common/extensions/api/settings_private.idl > File chrome/common/extensions/api/settings_private.idl (right): > > https://codereview.chromium.org/2479973002/diff/40001/chrome/common/extensions/api/settings_private.idl#newcode19 > ...
4 years, 1 month ago (2016-11-09 20:29:32 UTC) #5
Dan Beam
alright, all aboard the crazy train
4 years, 1 month ago (2016-11-12 00:45:15 UTC) #11
stevenjb
Thanks for digging into this. I clearly made some incorrect assumptions about how prefs were ...
4 years, 1 month ago (2016-11-12 01:31:46 UTC) #12
Dan Beam
https://codereview.chromium.org/2479973002/diff/100001/chrome/browser/extensions/api/settings_private/prefs_util.cc File chrome/browser/extensions/api/settings_private/prefs_util.cc (right): https://codereview.chromium.org/2479973002/diff/100001/chrome/browser/extensions/api/settings_private/prefs_util.cc#newcode672 chrome/browser/extensions/api/settings_private/prefs_util.cc:672: const settings_private::PrefObject& pref_object) { On 2016/11/12 01:31:46, stevenjb wrote: ...
4 years, 1 month ago (2016-11-15 05:38:39 UTC) #15
Dan Beam
+asargent@ for chrome/*/extensions
4 years, 1 month ago (2016-11-15 19:27:08 UTC) #21
stevenjb
lgtm https://codereview.chromium.org/2479973002/diff/100001/ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js File ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js (left): https://codereview.chromium.org/2479973002/diff/100001/ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js#oldcode54 ui/webui/resources/cr_elements/policy/cr_policy_indicator_behavior.js:54: break; On 2016/11/15 05:38:39, Dan Beam wrote: > ...
4 years, 1 month ago (2016-11-15 22:11:19 UTC) #22
Dan Beam
ping asargent@
4 years, 1 month ago (2016-11-16 19:28:13 UTC) #27
asargent_no_longer_on_chrome
On 2016/11/16 19:28:13, Dan Beam wrote: > ping asargent@ Sorry for delay, will get to ...
4 years, 1 month ago (2016-11-16 20:58:40 UTC) #28
asargent_no_longer_on_chrome
chrome/*/extensions/* lgtm
4 years, 1 month ago (2016-11-16 21:05:02 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2479973002/140001
4 years, 1 month ago (2016-11-16 21:29:46 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2479973002/140001
4 years, 1 month ago (2016-11-16 22:35:08 UTC) #36
commit-bot: I haz the power
Failed to apply patch for chrome/browser/extensions/api/settings_private/prefs_util.cc: While running git apply --index -p1; error: patch failed: ...
4 years, 1 month ago (2016-11-16 22:54:03 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2479973002/180001
4 years, 1 month ago (2016-11-16 23:18:51 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/182121)
4 years, 1 month ago (2016-11-17 00:35:18 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2479973002/180001
4 years, 1 month ago (2016-11-17 01:06:01 UTC) #49
commit-bot: I haz the power
Committed patchset #6 (id:180001)
4 years, 1 month ago (2016-11-17 02:09:44 UTC) #51
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/455f3cce3da21f8e677100b0c0abd8d35e24876e Cr-Commit-Position: refs/heads/master@{#432704}
4 years, 1 month ago (2016-11-17 02:13:20 UTC) #53
Dan Beam
3 years, 10 months ago (2017-02-23 01:49:39 UTC) #54
Message was sent while issue was closed.
https://codereview.chromium.org/2479973002/diff/180001/chrome/browser/extensi...
File chrome/browser/extensions/api/settings_private/prefs_util.cc (left):

https://codereview.chromium.org/2479973002/diff/180001/chrome/browser/extensi...
chrome/browser/extensions/api/settings_private/prefs_util.cc:440: if (pref &&
pref->IsExtensionControlled()) {
i probably broke stuff with this

Powered by Google App Engine
This is Rietveld 408576698