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

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 ab0045984bdb12551a6972b7299aa5fd3b0e7506..1c30a4590bf3abaf5552d5e0dcf10542ae4bd605 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
@@ -326,31 +326,25 @@ public class Website implements Serializable {
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;
- }
+ if (video == ContentSetting.ALLOW && voice == ContentSetting.ALLOW) {
+ return MICROPHONE_AND_CAMERA_ACCESS_ALLOWED;
+ }
+ if (video == ContentSetting.BLOCK && voice == ContentSetting.BLOCK) {
+ return MICROPHONE_AND_CAMERA_ACCESS_DENIED;
+ }
+ if (video == ContentSetting.ALLOW) {
+ return CAMERA_ACCESS_ALLOWED;
+ }
+ if (voice == ContentSetting.ALLOW) {
+ return MICROPHONE_ACCESS_ALLOWED;
+ }
+ if (video == ContentSetting.BLOCK) {
+ return CAMERA_ACCESS_DENIED;
+ }
+ if (voice == ContentSetting.BLOCK) {
+ return MICROPHONE_ACCESS_DENIED;
}
+ return INVALID_CAMERA_OR_MICROPHONE_ACCESS;
newt (away) 2015/04/16 17:11:20 as soon as we allow users to toggle these individu
Finnur 2015/04/22 16:01:38 No, lines 335 through 346 handle the case where on
}
public void setLocalStorageInfo(LocalStorageInfo info) {

Powered by Google App Engine
This is Rietveld 408576698