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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: Move permissions stuff to SensorProxy, remove aw related stuff Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
index d5440545aa6c2d5a41c96c153a397d144b4a9b39..9b432b3359768885649bb47a3d870865a645b553 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
@@ -36,6 +36,7 @@ public class Website implements Serializable {
private LocalStorageInfo mLocalStorageInfo;
private MicrophoneInfo mMicrophoneInfo;
private MidiInfo mMidiInfo;
+ private SensorInfo mSensorInfo;
private NotificationInfo mNotificationInfo;
private ContentSettingException mPopupException;
private ProtectedMediaIdentifierInfo mProtectedMediaIdentifierInfo;
@@ -315,6 +316,31 @@ public class Website implements Serializable {
}
/**
+ * Sets the SensorInfo object for this Website.
+ */
+ public void setSensorInfo(SensorInfo info) {
+ mSensorInfo = info;
+ }
+
+ public SensorInfo getSensorInfo() {
+ return mSensorInfo;
+ }
+ /**
+ * Returns what permission governs Sensors usage access.
+ */
+ public ContentSetting getSensorsPermission() {
+ return mSensorInfo != null ? mSensorInfo.getContentSetting() : null;
+ }
+ /**
+ * Configure Sensors usage access setting for this site.
+ */
+ public void setSensorsPermission(ContentSetting value) {
+ if (mSensorInfo != null) {
+ mSensorInfo.setContentSetting(value);
+ }
+ }
+
+ /**
* Sets Notification access permission information class.
*/
public void setNotificationInfo(NotificationInfo info) {

Powered by Google App Engine
This is Rietveld 408576698