New issue
Advanced search Search tips

Issue 906199 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Task

Blocked on:
issue 619783



Sign in to add a comment

Add WebStateObserver callbacks which signal clearing browsing data operation

Project Member Reported by justincohen@chromium.org, Nov 16

Issue description

crrev.com/c/1339340 removes most visited tiles from NTP after clearing browsing data.
The current implementation is not ideal and could be improved by adding WebStateObserver::DidRemoveBrowsingData callback.
 

Comment 1 Deleted

Comment 2 Deleted

Comment 3 Deleted

Labels: -Type-Bug Type-Task
The WebUsageEnabled observer callbacks came from crrev.com/c/1339340

Here's how I suggested that the current implementation could be improved:

The approach in this CL looks like it will work, but I think it could be improved.  How about this?

- Add a WebStateObserver callback for when web usage is enabled/disabled.
- Catch this change in the NTPTabHelper.
- Notify tab helperdelegate that the coordinator should be stopped when webUsageEnabled is set to NO.

Arranging the code this way would help to decouple BVC from the NTP coordinators; implementing it this way will make it easier to tease out the NTP coordinator code into BrowserViewCoordinator (or whatever we end up calling the coordinator that manages BVC after future refactoring).
It's interesting that webUsageEnabled is going to be removed.  We currently show an overlay over the browser when web usage is disabled to prevent browser usage right?  This UI could also similarly be managed using a WebStateObserver tab helper that starts/stops that UI via delegation.
The naming stuff just came up as we discussed what we would call the observer callback, and I'm pretty flexible as to what we want to do there.  It just seems we have a couple different ways of naming these callbacks, so it's not as clear what a new "notify of a property change" type observer callback should be named.
Labels: -M-73
Thanks for the explanation. Per my previous comments, I would like us to remove SetWebUsageEnabled/GetWebUsageEnabled public API and replace with cookie clearing public API. Starting from iOS 12, there is no need to call SetWebUsageEnabled for cookie clearing, so we would only call SetWebUsageEnabled for iOS 11 inside ios/web.

We could add WebStateObserve::WillRemoveBrowsingData WebStateObserve::DidRemoveBrowsingData for NewTabTabHelper to observe.

I will update the bug description and summary to capture the requirements.


Summary: Add WebStateObserver callbacks which signal clearing browsing data operation (was: Clean up WebStateObserver naming and add WebUsageEnabled)
Description: Show this description
Blockedon: 619783
Re to #6: We show this overlay during browsing data clearing. We could use WebStateObserver::WillRemoveBrowsingData WebStateObserver::DidRemoveBrowsingData for controlling overlay presence.
Owner: eugene...@chromium.org
Status: Assigned (was: Untriaged)
Owner: ----
Status: Available (was: Assigned)
Cc: mrefaat@chromium.org

Sign in to add a comment