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

Unified Diff: ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm

Issue 2671743002: Separate state of basic and advanced tab in CBD dialog (Closed)
Patch Set: rebase and fix compilation Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm b/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
index 125e0fdf32bfaeb197913b8145561215ea634eda..33feb18a8d8189391991e5c79f29fb1efd55f625 100644
--- a/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/clear_browsing_data_collection_view_controller.mm
@@ -192,12 +192,14 @@ const int kMaxTimesHistoryNoticeShown = 1;
int prefValue = browserState->GetPrefs()->GetInteger(
browsing_data::prefs::kDeleteTimePeriod);
prefValue = MAX(0, prefValue);
- if (prefValue > browsing_data::TIME_PERIOD_LAST) {
- prefValue = browsing_data::TIME_PERIOD_LAST;
+ const int maxValue =
+ static_cast<int>(browsing_data::TimePeriod::TIME_PERIOD_LAST);
+ if (prefValue > maxValue) {
+ prefValue = maxValue;
}
_timePeriod = static_cast<browsing_data::TimePeriod>(prefValue);
} else {
- _timePeriod = browsing_data::ALL_TIME;
+ _timePeriod = browsing_data::TimePeriod::ALL_TIME;
}
self.title = l10n_util::GetNSString(IDS_IOS_CLEAR_BROWSING_DATA_TITLE);
@@ -803,7 +805,7 @@ const int kMaxTimesHistoryNoticeShown = 1;
(~NSByteCountFormatterUseKB);
formatter.get().countStyle = NSByteCountFormatterCountStyleMemory;
NSString* formattedSize = [formatter stringFromByteCount:cacheSizeBytes];
- return (_timePeriod == browsing_data::ALL_TIME)
+ return (_timePeriod == browsing_data::TimePeriod::ALL_TIME)
? formattedSize
: l10n_util::GetNSStringF(
IDS_DEL_CACHE_COUNTER_UPPER_ESTIMATE,

Powered by Google App Engine
This is Rietveld 408576698