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

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

Issue 2159533002: Add a section to Site Settings listing USB devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@android_usb_settings
Patch Set: Iterate ArrayLists by index. Created 4 years, 4 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.util.Pair; 7 import android.util.Pair;
8 8
9 import org.chromium.base.Callback; 9 import org.chromium.base.Callback;
10 import org.chromium.chrome.browser.ContentSettingsType; 10 import org.chromium.chrome.browser.ContentSettingsType;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 queue.add(new NotificationInfoFetcher()); 133 queue.add(new NotificationInfoFetcher());
134 } else if (category.showBackgroundSyncSites()) { 134 } else if (category.showBackgroundSyncSites()) {
135 // Background sync info is per-origin. 135 // Background sync info is per-origin.
136 queue.add(new BackgroundSyncExceptionInfoFetcher()); 136 queue.add(new BackgroundSyncExceptionInfoFetcher());
137 } else if (category.showProtectedMediaSites()) { 137 } else if (category.showProtectedMediaSites()) {
138 // Protected media identifier permission is per-origin and per-embed der. 138 // Protected media identifier permission is per-origin and per-embed der.
139 queue.add(new ProtectedMediaIdentifierInfoFetcher()); 139 queue.add(new ProtectedMediaIdentifierInfoFetcher());
140 } else if (category.showAutoplaySites()) { 140 } else if (category.showAutoplaySites()) {
141 // Autoplay permission is per-origin. 141 // Autoplay permission is per-origin.
142 queue.add(new AutoplayExceptionInfoFetcher()); 142 queue.add(new AutoplayExceptionInfoFetcher());
143 } else if (category.showUsbDevices()) {
144 // USB device permission is per-origin.
145 queue.add(new UsbInfoFetcher());
143 } 146 }
144 queue.add(new PermissionsAvailableCallbackRunner()); 147 queue.add(new PermissionsAvailableCallbackRunner());
145 queue.next(); 148 queue.next();
146 } 149 }
147 150
148 private Website findOrCreateSite(WebsiteAddress origin, WebsiteAddress embed der) { 151 private Website findOrCreateSite(WebsiteAddress origin, WebsiteAddress embed der) {
149 // In Jelly Bean a null value triggers a NullPointerException in Pair.ha shCode(). Storing 152 // In Jelly Bean a null value triggers a NullPointerException in Pair.ha shCode(). Storing
150 // the origin twice works around it and won't conflict with other entrie s as this is how the 153 // the origin twice works around it and won't conflict with other entrie s as this is how the
151 // native code indicates to this class that embedder == origin. https:/ /crbug.com/636330 154 // native code indicates to this class that embedder == origin. https:/ /crbug.com/636330
152 Pair<WebsiteAddress, WebsiteAddress> key = 155 Pair<WebsiteAddress, WebsiteAddress> key =
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 409 }
407 } 410 }
408 411
409 private class PermissionsAvailableCallbackRunner extends Task { 412 private class PermissionsAvailableCallbackRunner extends Task {
410 @Override 413 @Override
411 public void run() { 414 public void run() {
412 mCallback.onWebsitePermissionsAvailable(mSites.values()); 415 mCallback.onWebsitePermissionsAvailable(mSites.values());
413 } 416 }
414 } 417 }
415 } 418 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698