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

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: rebase + blink reformat Created 3 years, 8 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 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 df376b27c439f6e3489deacfba999d65115f36da..43e3f897b230f72d2d6e671fced3bfa98840b6db 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
@@ -35,6 +35,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 ContentSettingException mSubresourceFilterException;
@@ -293,6 +294,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