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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java

Issue 2562123003: [Android History] Add clear browsing data button and privacy disclaimers (Closed)
Patch Set: [Android History] Add clear browsing data button and privacy disclaimers Created 4 years 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: chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
index f2738ad8754e5ae823942d14466318c2557cf85b..8a662f010b38277c60da66ab373732f16e572b56 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
@@ -17,6 +17,8 @@ import android.view.ViewGroup;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.IntentHandler;
import org.chromium.chrome.browser.document.ChromeLauncherActivity;
+import org.chromium.chrome.browser.preferences.PreferencesLauncher;
+import org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataPreferences;
import org.chromium.chrome.browser.util.IntentUtils;
import org.chromium.chrome.browser.widget.TintedDrawable;
import org.chromium.chrome.browser.widget.selection.SelectableListLayout;
@@ -114,14 +116,14 @@ public class HistoryManager implements OnMenuItemClickListener {
}
/**
- * Open the history item.
- * @param url The URL of the history item.
- * @param isIncognito Whether to open the history item in an incognito tab. If null, the tab
+ * Open the provided url.
+ * @param url The url to open.
+ * @param isIncognito Whether to open the url in an incognito tab. If null, the tab
* will open in the current tab model.
* @param createNewTab Whether a new tab should be created. If false, the item will clobber the
* the current tab.
*/
- public void openItem(String url, Boolean isIncognito, boolean createNewTab) {
+ public void openUrl(String url, Boolean isIncognito, boolean createNewTab) {
// Construct basic intent.
Intent viewIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
viewIntent.putExtra(Browser.EXTRA_APPLICATION_ID,
@@ -151,9 +153,18 @@ public class HistoryManager implements OnMenuItemClickListener {
IntentHandler.startActivityForTrustedIntent(viewIntent, mActivity);
}
+ /**
+ * Opens the clear browsing data preference.
+ */
+ public void openClearBrowsingDataPreference() {
+ Intent intent = PreferencesLauncher.createIntentForSettingsPage(mActivity,
+ ClearBrowsingDataPreferences.class.getName());
+ IntentUtils.safeStartActivity(mActivity, intent);
+ }
+
private void openItemsInNewTabs(List<HistoryItem> items, boolean isIncognito) {
for (HistoryItem item : items) {
- openItem(item.getUrl(), isIncognito, true);
+ openUrl(item.getUrl(), isIncognito, true);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698