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

Issue 2645863004: Simplify managing visibility of extensions in settings. (Closed)

Created:
3 years, 11 months ago by mtomasz
Modified:
3 years, 10 months ago
Reviewers:
lazyboy
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, arv+watch_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Simplify managing visibility of extensions in settings. Summary of behavior: - chrome.management API will expose everything which is not component including themes and hosted apps (no change). It will never expose components, even with --show-component-extensions-options. - chrome://extensions will show the same as before this CL, so no themes, sometimes hosted documents (only if unpacked), etc (no change). What changed is that we will show all components in chrome://extensions if --show-component-extensions-options is passed. Before we would only show those not hidden from the app launcher (sic). We have too many methods for determining visibility, and they were contradicting each other. Eg. ShouldNotBeVisible() which is documented as whether it should be visible *anywhere* can return true, while ShouldDisplayInAppLauncher could return false in the same time. In different places we use different of the above methods causing inconsistent behavior, eg. component extensions would be shown in chrome://extensions when --show-component-extensions-options is used, but excluding component extensions which are hidden from launcher. Finally, the logic in methods for determining visibility was too complex, and as a result it was difficult to say whether something will be visible in some parts of Chrome UI or not. This CL removes the umbrella ShouldNotBeVisible() method, and introduces ShouldExposeInManagementAPI. Also, callers have been updated to use either ShouldDisplayInExtensionSettings or ShouldDisplayInAppLancher or ShouldDisplayInNewTabPage or ShouldExposeInManagementAPI depending on what is the caller. Ideally, all of the Should* should rather be moved to the callers, as the callers better know what to display or show, rather than the Extension class. However, for consistency ShouldExposeInManagementAPI was added. Finally, this CL simplifies the logic for determining visibility by assuming that by default everything is visible, and filtering out things which we want to hide (no more return true/false every second line). BUG=680429 TEST=Confirm that all component extensions are visible in chrome://extensions when --show-component-extensions-options is passed. Also, confirm there are no regressions, so no component extensions shown in chrome://extensions by default. Also, confirm that chrome.management API doesn't regress by using the "Chrome Apps & Extensions Developer Tool". CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Review-Url: https://codereview.chromium.org/2645863004 Cr-Commit-Position: refs/heads/master@{#446543} Committed: https://chromium.googlesource.com/chromium/src/+/79fc3e73cfaa2b0b3b51d9e0176f5463cc7bb565

Patch Set 1 #

Patch Set 2 : Remove accidental change. #

Patch Set 3 : Fixed logic so tests pass. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -46 lines) Patch
M chrome/browser/extensions/extension_ui_util.h View 1 chunk +0 lines, -7 lines 0 comments Download
M chrome/browser/extensions/extension_ui_util.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M extensions/browser/api/management/management_api.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M extensions/common/extension.h View 1 2 1 chunk +3 lines, -4 lines 0 comments Download
M extensions/common/extension.cc View 1 2 1 chunk +10 lines, -24 lines 4 comments Download

Messages

Total messages: 31 (23 generated)
mtomasz
@rdcronin: PTAL. Thanks!
3 years, 11 months ago (2017-01-20 01:34:29 UTC) #5
mtomasz
@lazyboy: PTAL. Thanks!
3 years, 11 months ago (2017-01-23 02:54:10 UTC) #15
lazyboy
Thanks. Here's what I got: 1) and 2a/2b) below in the comments are the two ...
3 years, 11 months ago (2017-01-23 22:22:26 UTC) #22
mtomasz
On 2017/01/23 22:22:26, lazyboy wrote: > Thanks. Here's what I got: 1) and 2a/2b) below ...
3 years, 11 months ago (2017-01-24 00:43:09 UTC) #24
mtomasz
https://codereview.chromium.org/2645863004/diff/40001/extensions/common/extension.cc File extensions/common/extension.cc (left): https://codereview.chromium.org/2645863004/diff/40001/extensions/common/extension.cc#oldcode393 extensions/common/extension.cc:393: if (is_app() && !ShouldDisplayInAppLauncher() && !ShouldDisplayInNewTabPage()) On 2017/01/23 22:22:26, ...
3 years, 11 months ago (2017-01-26 08:38:30 UTC) #25
lazyboy
thanks, lgtm.
3 years, 11 months ago (2017-01-26 18:20:22 UTC) #26
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/2645863004/40001
3 years, 10 months ago (2017-01-27 00:35:18 UTC) #28
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 02:34:55 UTC) #31
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/79fc3e73cfaa2b0b3b51d9e0176f...

Powered by Google App Engine
This is Rietveld 408576698