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 org.chromium.chrome.browser.ContentSettingsType; | 7 import org.chromium.chrome.browser.ContentSettingsType; |
8 | 8 |
9 import java.util.ArrayList; | 9 import java.util.ArrayList; |
10 import java.util.HashMap; | 10 import java.util.HashMap; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 TaskQueue queue = new TaskQueue(); | 56 TaskQueue queue = new TaskQueue(); |
57 // Populate features from more specific to less specific. | 57 // Populate features from more specific to less specific. |
58 // Geolocation lookup permission is per-origin and per-embedder. | 58 // Geolocation lookup permission is per-origin and per-embedder. |
59 queue.add(new GeolocationInfoFetcher()); | 59 queue.add(new GeolocationInfoFetcher()); |
60 // Midi sysex access permission is per-origin and per-embedder. | 60 // Midi sysex access permission is per-origin and per-embedder. |
61 queue.add(new MidiInfoFetcher()); | 61 queue.add(new MidiInfoFetcher()); |
62 // Cookies are stored per-origin. | 62 // Cookies are stored per-origin. |
63 queue.add(new CookieInfoFetcher()); | 63 queue.add(new CookieInfoFetcher()); |
64 // Fullscreen are stored per-origin. | 64 // Fullscreen are stored per-origin. |
65 queue.add(new FullscreenInfoFetcher()); | 65 queue.add(new FullscreenInfoFetcher()); |
| 66 // Keygen permissions are per-origin. |
| 67 queue.add(new KeygenInfoFetcher()); |
66 // Local storage info is per-origin. | 68 // Local storage info is per-origin. |
67 queue.add(new LocalStorageInfoFetcher()); | 69 queue.add(new LocalStorageInfoFetcher()); |
68 // Website storage is per-host. | 70 // Website storage is per-host. |
69 queue.add(new WebStorageInfoFetcher()); | 71 queue.add(new WebStorageInfoFetcher()); |
70 // Popup exceptions are host-based patterns (unless we start | 72 // Popup exceptions are host-based patterns (unless we start |
71 // synchronizing popup exceptions with desktop Chrome.) | 73 // synchronizing popup exceptions with desktop Chrome.) |
72 queue.add(new PopupExceptionInfoFetcher()); | 74 queue.add(new PopupExceptionInfoFetcher()); |
73 // JavaScript exceptions are host-based patterns. | 75 // JavaScript exceptions are host-based patterns. |
74 queue.add(new JavaScriptExceptionInfoFetcher()); | 76 queue.add(new JavaScriptExceptionInfoFetcher()); |
75 // Protected media identifier permission is per-origin and per-embedder. | 77 // Protected media identifier permission is per-origin and per-embedder. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 if (address == null) continue; | 240 if (address == null) continue; |
239 Set<Website> sites = findOrCreateSitesByHost(address); | 241 Set<Website> sites = findOrCreateSitesByHost(address); |
240 for (Website site : sites) { | 242 for (Website site : sites) { |
241 site.setJavaScriptException(exception); | 243 site.setJavaScriptException(exception); |
242 } | 244 } |
243 } | 245 } |
244 queue.next(); | 246 queue.next(); |
245 } | 247 } |
246 } | 248 } |
247 | 249 |
| 250 private class KeygenInfoFetcher implements Task { |
| 251 @Override |
| 252 public void run(TaskQueue queue) { |
| 253 for (KeygenInfo info : WebsitePreferenceBridge.getKeygenInfo()) { |
| 254 WebsiteAddress address = WebsiteAddress.create(info.getOrigin())
; |
| 255 if (address == null) continue; |
| 256 createSiteByOriginAndHost(address).setKeygenInfo(info); |
| 257 } |
| 258 queue.next(); |
| 259 } |
| 260 } |
| 261 |
248 private class CookieInfoFetcher implements Task { | 262 private class CookieInfoFetcher implements Task { |
249 @Override | 263 @Override |
250 public void run(TaskQueue queue) { | 264 public void run(TaskQueue queue) { |
251 for (CookieInfo info : WebsitePreferenceBridge.getCookieInfo()) { | 265 for (CookieInfo info : WebsitePreferenceBridge.getCookieInfo()) { |
252 WebsiteAddress address = WebsiteAddress.create(info.getOrigin())
; | 266 WebsiteAddress address = WebsiteAddress.create(info.getOrigin())
; |
253 if (address == null) continue; | 267 if (address == null) continue; |
254 createSiteByOriginAndHost(address).setCookieInfo(info); | 268 createSiteByOriginAndHost(address).setCookieInfo(info); |
255 } | 269 } |
256 queue.next(); | 270 queue.next(); |
257 } | 271 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 383 } |
370 | 384 |
371 private class PermissionsAvailableCallbackRunner implements Task { | 385 private class PermissionsAvailableCallbackRunner implements Task { |
372 @Override | 386 @Override |
373 public void run(TaskQueue queue) { | 387 public void run(TaskQueue queue) { |
374 mCallback.onWebsitePermissionsAvailable(mSitesByOrigin, mSitesByHost
); | 388 mCallback.onWebsitePermissionsAvailable(mSitesByOrigin, mSitesByHost
); |
375 queue.next(); | 389 queue.next(); |
376 } | 390 } |
377 } | 391 } |
378 } | 392 } |
OLD | NEW |