Commit 33a49c9d authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Enable the clearing of browsing data in web

This CL enables the feature by default.
It also runs directly the closure instead of posting it to have the
sequence_checker validated.

It also removes the observation of the browsing data removal in the
WebController. This is because disabling the WebUsage is supposed to
be tied to the spinner displayed on browser.
We should find a way of synchronizing both of them.

Bug: 981375
Change-Id: Iac47974e0d34f6977b2879dc00cd049e3950e387
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847308
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708580}
parent 7b436ddd
...@@ -8,7 +8,7 @@ const base::Feature kNewClearBrowsingDataUI{"NewClearBrowsingDataUI", ...@@ -8,7 +8,7 @@ const base::Feature kNewClearBrowsingDataUI{"NewClearBrowsingDataUI",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kWebClearBrowsingData{"WebClearBrowsingData", const base::Feature kWebClearBrowsingData{"WebClearBrowsingData",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
bool IsNewClearBrowsingDataUIEnabled() { bool IsNewClearBrowsingDataUIEnabled() {
return base::FeatureList::IsEnabled(kNewClearBrowsingDataUI); return base::FeatureList::IsEnabled(kNewClearBrowsingDataUI);
......
...@@ -79,7 +79,7 @@ void BrowsingDataRemover::ClearBrowsingData(ClearBrowsingDataMask types, ...@@ -79,7 +79,7 @@ void BrowsingDataRemover::ClearBrowsingData(ClearBrowsingDataMask types,
} }
if (![data_types_to_remove count]) { if (![data_types_to_remove count]) {
base::PostTask(FROM_HERE, base::BindOnce(std::move(block_closure))); std::move(block_closure).Run();
return; return;
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/metrics/user_metrics_action.h" #include "base/metrics/user_metrics_action.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#import "ios/web/browsing_data/browsing_data_remover.h" #import "ios/web/browsing_data/browsing_data_remover.h"
#import "ios/web/browsing_data/browsing_data_remover_observer.h"
#import "ios/web/common/crw_web_view_content_view.h" #import "ios/web/common/crw_web_view_content_view.h"
#include "ios/web/common/features.h" #include "ios/web/common/features.h"
#include "ios/web/common/url_util.h" #include "ios/web/common/url_util.h"
...@@ -90,8 +89,7 @@ NSString* const kScriptMessageName = @"crwebinvoke"; ...@@ -90,8 +89,7 @@ NSString* const kScriptMessageName = @"crwebinvoke";
} // namespace } // namespace
@interface CRWWebController () <BrowsingDataRemoverObserver, @interface CRWWebController () <CRWWKNavigationHandlerDelegate,
CRWWKNavigationHandlerDelegate,
CRWContextMenuDelegate, CRWContextMenuDelegate,
CRWJSInjectorDelegate, CRWJSInjectorDelegate,
CRWLegacyNativeContentControllerDelegate, CRWLegacyNativeContentControllerDelegate,
...@@ -308,7 +306,6 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*); ...@@ -308,7 +306,6 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
web::BrowserState* browserState = _webStateImpl->GetBrowserState(); web::BrowserState* browserState = _webStateImpl->GetBrowserState();
_certVerificationController = [[CRWCertVerificationController alloc] _certVerificationController = [[CRWCertVerificationController alloc]
initWithBrowserState:browserState]; initWithBrowserState:browserState];
web::BrowsingDataRemover::FromBrowserState(browserState)->AddObserver(self);
web::FindInPageManagerImpl::CreateForWebState(_webStateImpl); web::FindInPageManagerImpl::CreateForWebState(_webStateImpl);
_faviconManager = std::make_unique<web::FaviconManager>(_webStateImpl); _faviconManager = std::make_unique<web::FaviconManager>(_webStateImpl);
_jsWindowErrorManager = _jsWindowErrorManager =
...@@ -1040,16 +1037,6 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*); ...@@ -1040,16 +1037,6 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
[_pendingLoadCompleteActions removeAllObjects]; [_pendingLoadCompleteActions removeAllObjects];
} }
#pragma mark - BrowsingDataRemoverObserver
- (void)willRemoveBrowsingData:(web::BrowsingDataRemover*)dataRemover {
self.webUsageEnabled = NO;
}
- (void)didRemoveBrowsingData:(web::BrowsingDataRemover*)dataRemover {
self.webUsageEnabled = YES;
}
#pragma mark - JavaScript history manipulation #pragma mark - JavaScript history manipulation
// Updates the HTML5 history state of the page using the current NavigationItem. // Updates the HTML5 history state of the page using the current NavigationItem.
......
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