| 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.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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |