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

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

Issue 1084423002: Split Camera and Mic into two permissions on the Site Details page (under Site Settings). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Polish Created 5 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 8f5bc2ba3631b867f1b7103f5cbc439a82c83dfe..46df1fb15118b2f89b2d9a32709a6cc3d29a0328 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
@@ -24,8 +24,10 @@ public class Website implements Serializable {
private final WebsiteAddress mAddress;
private final String mTitle;
private String mSummary;
+ private CameraCaptureInfo mCameraCaptureInfo;
private CookieInfo mCookieInfo;
private GeolocationInfo mGeolocationInfo;
+ private MicrophoneCaptureInfo mMicrophoneCaptureInfo;
private MidiInfo mMidiInfo;
private ContentSettingException mImagesException;
private ContentSettingException mJavaScriptException;
@@ -311,70 +313,61 @@ public class Website implements Serializable {
}
/**
- * Returns what setting governs voice capture access.
+ * Sets camera capture info class.
*/
- public ContentSetting getVoiceCapturePermission() {
- return mVoiceAndVideoCaptureInfo != null
- ? mVoiceAndVideoCaptureInfo.getVoiceCapturePermission() : null;
+ public void setCameraCaptureInfo(CameraCaptureInfo info) {
newt (away) 2015/04/22 17:35:55 "setCameraInfo", and similarly for related methods
Finnur 2015/04/24 13:51:59 Done.
+ mCameraCaptureInfo = info;
+ WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
+ if (embedder != null) {
+ mSummary = embedder.getTitle();
+ }
+ }
+
+ public CameraCaptureInfo getCameraCaptureInfo() {
+ return mCameraCaptureInfo;
}
/**
- * Returns what setting governs video capture access.
+ * Sets microphone capture info class.
*/
- public ContentSetting getVideoCapturePermission() {
- return mVoiceAndVideoCaptureInfo != null
- ? mVoiceAndVideoCaptureInfo.getVideoCapturePermission() : null;
+ public void setMicrophoneCaptureInfo(MicrophoneCaptureInfo info) {
+ mMicrophoneCaptureInfo = info;
+ WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder());
+ if (embedder != null) {
+ mSummary = embedder.getTitle();
+ }
+ }
+
+ public MicrophoneCaptureInfo getMicrophoneCaptureInfo() {
+ return mMicrophoneCaptureInfo;
}
/**
- * Configure voice capture setting for this site.
+ * Returns what setting governs microphone capture access.
*/
- public void setVoiceCapturePermission(ContentSetting value) {
- if (mVoiceAndVideoCaptureInfo != null) {
- mVoiceAndVideoCaptureInfo.setVoiceCapturePermission(value);
- }
+ public ContentSetting getMicrophoneCapturePermission() {
+ return mMicrophoneCaptureInfo != null ? mMicrophoneCaptureInfo.getContentSetting() : null;
}
/**
- * Configure video capture setting for this site.
+ * Returns what setting governs camera capture access.
*/
- public void setVideoCapturePermission(ContentSetting value) {
- if (mVoiceAndVideoCaptureInfo != null) {
- mVoiceAndVideoCaptureInfo.setVideoCapturePermission(value);
- }
+ public ContentSetting getCameraCapturePermission() {
+ return mCameraCaptureInfo != null ? mCameraCaptureInfo.getContentSetting() : null;
}
/**
- * Returns the type of media that is being captured (audio/video/both).
- */
- public int getMediaAccessType() {
- ContentSetting voice = getVoiceCapturePermission();
- ContentSetting video = getVideoCapturePermission();
- if (video != null) {
- if (voice == null) {
- if (video == ContentSetting.ALLOW) {
- return CAMERA_ACCESS_ALLOWED;
- } else {
- return CAMERA_ACCESS_DENIED;
- }
- } else {
- if (video != voice) {
- return INVALID_CAMERA_OR_MICROPHONE_ACCESS;
- }
- if (video == ContentSetting.ALLOW && voice == ContentSetting.ALLOW) {
- return MICROPHONE_AND_CAMERA_ACCESS_ALLOWED;
- } else {
- return MICROPHONE_AND_CAMERA_ACCESS_DENIED;
- }
- }
- } else {
- if (voice == null) return INVALID_CAMERA_OR_MICROPHONE_ACCESS;
- if (voice == ContentSetting.ALLOW) {
- return MICROPHONE_ACCESS_ALLOWED;
- } else {
- return MICROPHONE_ACCESS_DENIED;
- }
- }
+ * Configure microphone capture setting for this site.
+ */
+ public void setMicrophoneCapturePermission(ContentSetting value) {
+ if (mMicrophoneCaptureInfo != null) mMicrophoneCaptureInfo.setContentSetting(value);
+ }
+
+ /**
+ * Configure video capture setting for this site.
newt (away) 2015/04/22 17:35:55 s/video/camera
Finnur 2015/04/24 13:51:59 Done.
+ */
+ public void setCameraCapturePermission(ContentSetting value) {
+ if (mCameraCaptureInfo != null) mCameraCaptureInfo.setContentSetting(value);
}
public void setLocalStorageInfo(LocalStorageInfo info) {

Powered by Google App Engine
This is Rietveld 408576698