| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 java.io.Serializable; | 7 import java.io.Serializable; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * USB device information for a given origin. | 10 * USB device information for a given origin. |
| 11 * |
| 12 * These objects are compared only by the identity of the device, not by which s
ite has permission |
| 13 * to access it. |
| 11 */ | 14 */ |
| 12 public class UsbInfo implements Serializable { | 15 public class UsbInfo implements Serializable { |
| 13 private final String mOrigin; | 16 private final String mOrigin; |
| 14 private final String mEmbedder; | 17 private final String mEmbedder; |
| 15 private final String mName; | 18 private final String mName; |
| 16 private final String mObject; | 19 private final String mObject; |
| 17 | 20 |
| 18 UsbInfo(String origin, String embedder, String name, String object) { | 21 UsbInfo(String origin, String embedder, String name, String object) { |
| 19 mOrigin = origin; | 22 mOrigin = origin; |
| 20 mEmbedder = embedder; | 23 mEmbedder = embedder; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 } | 40 } |
| 38 | 41 |
| 39 /** | 42 /** |
| 40 * Returns the name of the USB device for display in the UI. | 43 * Returns the name of the USB device for display in the UI. |
| 41 */ | 44 */ |
| 42 public String getName() { | 45 public String getName() { |
| 43 return mName; | 46 return mName; |
| 44 } | 47 } |
| 45 | 48 |
| 46 /** | 49 /** |
| 50 * Returns the opaque object string that represents the device. |
| 51 */ |
| 52 public String getObject() { |
| 53 return mObject; |
| 54 } |
| 55 |
| 56 /** |
| 47 * Revokes permission for the origin to access the USB device. | 57 * Revokes permission for the origin to access the USB device. |
| 48 */ | 58 */ |
| 49 public void revoke() { | 59 public void revoke() { |
| 50 WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mO
bject); | 60 WebsitePreferenceBridge.nativeRevokeUsbPermission(mOrigin, mEmbedder, mO
bject); |
| 51 } | 61 } |
| 52 } | 62 } |
| OLD | NEW |