OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.preferences.privacy; | 5 package org.chromium.chrome.browser.preferences.privacy; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.ProgressDialog; | 8 import android.app.ProgressDialog; |
9 import android.content.Intent; | 9 import android.content.Intent; |
10 import android.graphics.drawable.Drawable; | 10 import android.graphics.drawable.Drawable; |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 /** | 498 /** |
499 * @return The id of the preference xml that should be displayed. | 499 * @return The id of the preference xml that should be displayed. |
500 */ | 500 */ |
501 protected int getPreferenceXmlId() { | 501 protected int getPreferenceXmlId() { |
502 return R.xml.clear_browsing_data_preferences; | 502 return R.xml.clear_browsing_data_preferences; |
503 } | 503 } |
504 | 504 |
505 @Override | 505 @Override |
506 public void onCreate(Bundle savedInstanceState) { | 506 public void onCreate(Bundle savedInstanceState) { |
507 super.onCreate(savedInstanceState); | 507 super.onCreate(savedInstanceState); |
508 RecordUserAction.record("ClearBrowsingData_DialogCreated"); | 508 // Don't record this action if TabsInCBD is enabled because this class i
s created twice. |
| 509 // The action will be recorded in ClearBrowsingDataTabsFragment instead. |
| 510 if (!ClearBrowsingDataTabsFragment.isFeatureEnabled()) { |
| 511 RecordUserAction.record("ClearBrowsingData_DialogCreated"); |
| 512 } |
509 mMaxImportantSites = BrowsingDataBridge.getMaxImportantSites(); | 513 mMaxImportantSites = BrowsingDataBridge.getMaxImportantSites(); |
510 BrowsingDataBridge.getInstance().requestInfoAboutOtherFormsOfBrowsingHis
tory(this); | 514 BrowsingDataBridge.getInstance().requestInfoAboutOtherFormsOfBrowsingHis
tory(this); |
511 getActivity().setTitle(R.string.clear_browsing_data_title); | 515 getActivity().setTitle(R.string.clear_browsing_data_title); |
512 PreferenceUtils.addPreferencesFromResource(this, getPreferenceXmlId()); | 516 PreferenceUtils.addPreferencesFromResource(this, getPreferenceXmlId()); |
513 DialogOption[] options = getDialogOptions(); | 517 DialogOption[] options = getDialogOptions(); |
514 mItems = new Item[options.length]; | 518 mItems = new Item[options.length]; |
515 for (int i = 0; i < options.length; i++) { | 519 for (int i = 0; i < options.length; i++) { |
516 boolean enabled = true; | 520 boolean enabled = true; |
517 | 521 |
518 // It is possible to disable the deletion of browsing history. | 522 // It is possible to disable the deletion of browsing history. |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 "History.ClearBrowsingData.ImportantIgnoredPercent", | 749 "History.ClearBrowsingData.ImportantIgnoredPercent", |
746 ignoredDomains.length * IMPORTANT_SITES_PERCENTAGE_BUCKE
T_COUNT | 750 ignoredDomains.length * IMPORTANT_SITES_PERCENTAGE_BUCKE
T_COUNT |
747 / mSortedImportantDomains.length, | 751 / mSortedImportantDomains.length, |
748 IMPORTANT_SITES_PERCENTAGE_BUCKET_COUNT + 1); | 752 IMPORTANT_SITES_PERCENTAGE_BUCKET_COUNT + 1); |
749 } | 753 } |
750 clearBrowsingData(getSelectedOptions(), deselectedDomains, deselecte
dDomainReasons, | 754 clearBrowsingData(getSelectedOptions(), deselectedDomains, deselecte
dDomainReasons, |
751 ignoredDomains, ignoredDomainReasons); | 755 ignoredDomains, ignoredDomainReasons); |
752 } | 756 } |
753 } | 757 } |
754 } | 758 } |
OLD | NEW |