Commit 0cc13cc9 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Sets and registers prefs::kLastClearBrowsingDataTime on iOS

This will be used in future CL's to prevent certain behaviours
for some time after CBD has been triggered.

Bug: 1085419
Change-Id: I24d9a4878d05339911ec7bd95df6773ebc28f2dd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359549
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798942}
parent a7423d3e
...@@ -76,6 +76,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) { ...@@ -76,6 +76,7 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref( registry->RegisterBooleanPref(
kDeleteSiteSettings, false, kDeleteSiteSettings, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
#else
registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, 0); registry->RegisterInt64Pref(prefs::kLastClearBrowsingDataTime, 0);
#endif // !defined(OS_IOS) #endif // !defined(OS_IOS)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/mac/foundation_util.h" #include "base/mac/foundation_util.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h" #include "base/metrics/user_metrics_action.h"
#include "components/browsing_data/core/pref_names.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h" #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/browsing_data/browsing_data_features.h" #include "ios/chrome/browser/browsing_data/browsing_data_features.h"
...@@ -341,6 +342,11 @@ ...@@ -341,6 +342,11 @@
}); });
}; };
// Set the kLastClearBrowsingDataTime Pref.
self.browserState->GetPrefs()->SetInt64(
browsing_data::prefs::kLastClearBrowsingDataTime,
base::Time::Now().ToTimeT());
[self.dispatcher [self.dispatcher
removeBrowsingDataForBrowserState:browserState removeBrowsingDataForBrowserState:browserState
timePeriod:timePeriod timePeriod:timePeriod
......
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