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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.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 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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698