| Code-Review | +1 |
browser_command_controller.cc and chrome/test/BUILD.gn lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks! Adding closer OWNERS, as the CL is nontrivial:
Yang for devtools/
Enterprise for *policy*
Will stamp whatever's left for OWNERS afther those LGTMs come in
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Reviewer source(s):
alsh...@chromium.org is from context(chrome/enterprise/gwsq/cep-review.gwsq)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
}Please also cover the following cases:
// profile_->GetProfilePolicyConnector()->policy_service()->AddObserver(Please remove
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I don't think I'm a proper reviewer for this code.
It looks like @blun...@chromium.org is also asked to review this change, and his OWNERS overlaps with mine.
Removing myself from the requested reviewers.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Reviewer source(s):
igo...@chromium.org is from context(chrome/enterprise/gwsq/enterprise-policy-review.gwsq)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
profile, static_cast<const extensions::Extension*>(nullptr));nit: You shouldn't need to cast nullptr, do you get a compilation error without this cast?
if (extension) {
if (extensions::Manifest::IsPolicyLocation(extension->location())) {
return false;
}
if (extensions::Manifest::IsComponentLocation(extension->location()) &&
profile->GetProfilePolicyConnector()->IsManaged()) {
return false;
}
}nit: Merge these into one condition and one return statement.
policy::DeveloperToolsPolicyChecker* checker =
policy::DeveloperToolsPolicyCheckerFactory::GetForBrowserContext(
profile);
if (checker->IsUrlAllowedByPolicy(extension->url())) {
return true;
}
if (checker->IsUrlBlockedByPolicy(extension->url())) {
return false;
}You use this snippet in 3 locations in this file, I think it should be in its own helper function, and also have an explanation that the Allow policy has precedence over the Blocklist one. You can make that helper in the Checker directly and have it return a URLBlocklistState value so you know if you have to return directly or check the enum policy.
// TODO(mickaczmarczyk) Add implementation for mobile.nit: Preferably, put bug IDs in TODOs and not your email.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
c/b/extensions lgtm, thanks!
if (checker) {
if (checker->IsUrlAllowedByPolicy(extension.url())) {
return true;
}
if (checker->IsUrlBlockedByPolicy(extension.url())) {
return false;
}
}nit: lets move this before availability (line 125), since we don't need to retrieve it if we return early. Can also be a helper method as mentioned on the other comment
Wish we could have a test for this, but `INSPECT_POPUP` visibility is not tested because there is no popup delegate on the [test](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/extensions/extension_context_menu_model_browsertest.cc;l=704-707. Adding that is not straightforward, so it's ok from the extensions side as long as DeveloperToolsPolicyCheckerFactory is tested separately.
| Code-Review | +1 |
LGTM for `chrome/browser/profiles/profile_keyed_service_browsertest.cc` with a minor nit.
Thanks!
"DeveloperToolsPolicyChecker",minor nit: Please try to keep this list ordered alphabetically. (aware that we are already not doing a good job :), but it would be great that new additions are as correct as possible!)
Maybe around line 414?