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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java

Issue 2953853002: [Android Site Settings] Disable fetching important sites when not needed (Closed)
Patch Set: comments Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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.website; 5 package org.chromium.chrome.browser.preferences.website;
6 6
7 import android.content.DialogInterface; 7 import android.content.DialogInterface;
8 import android.content.res.Resources; 8 import android.content.res.Resources;
9 import android.os.Bundle; 9 import android.os.Bundle;
10 import android.preference.Preference; 10 import android.preference.Preference;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 private static final String BLOCKED_GROUP = "blocked_group"; 102 private static final String BLOCKED_GROUP = "blocked_group";
103 103
104 private void getInfoForOrigins() { 104 private void getInfoForOrigins() {
105 if (!mCategory.enabledInAndroid(getActivity())) { 105 if (!mCategory.enabledInAndroid(getActivity())) {
106 // No need to fetch any data if we're not going to show it, but we d o need to update 106 // No need to fetch any data if we're not going to show it, but we d o need to update
107 // the global toggle to reflect updates in Android settings (e.g. Lo cation). 107 // the global toggle to reflect updates in Android settings (e.g. Lo cation).
108 resetList(); 108 resetList();
109 return; 109 return;
110 } 110 }
111 111
112 WebsitePermissionsFetcher fetcher = new WebsitePermissionsFetcher(new Re sultsPopulator()); 112 WebsitePermissionsFetcher fetcher =
113 new WebsitePermissionsFetcher(new ResultsPopulator(), false);
113 fetcher.fetchPreferencesForCategory(mCategory); 114 fetcher.fetchPreferencesForCategory(mCategory);
114 } 115 }
115 116
116 private void displayEmptyScreenMessage() { 117 private void displayEmptyScreenMessage() {
117 if (mEmptyView != null) { 118 if (mEmptyView != null) {
118 mEmptyView.setText(R.string.no_saved_website_settings); 119 mEmptyView.setText(R.string.no_saved_website_settings);
119 } 120 }
120 } 121 }
121 122
122 private class ResultsPopulator implements WebsitePermissionsFetcher.WebsiteP ermissionsCallback { 123 private class ResultsPopulator implements WebsitePermissionsFetcher.WebsiteP ermissionsCallback {
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 MediaDrmCredentialManager.resetCredentials(new MediaDrmCredentialManager Callback() { 772 MediaDrmCredentialManager.resetCredentials(new MediaDrmCredentialManager Callback() {
772 @Override 773 @Override
773 public void onCredentialResetFinished(boolean succeeded) { 774 public void onCredentialResetFinished(boolean succeeded) {
774 if (succeeded) return; 775 if (succeeded) return;
775 String message = getString(R.string.protected_content_reset_fail ed); 776 String message = getString(R.string.protected_content_reset_fail ed);
776 Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show( ); 777 Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show( );
777 } 778 }
778 }); 779 });
779 } 780 }
780 } 781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698