| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 org.chromium.chrome.browser.util.MathUtils; | 7 import org.chromium.chrome.browser.util.MathUtils; |
| 8 | 8 |
| 9 import java.io.Serializable; | 9 import java.io.Serializable; |
| 10 import java.util.ArrayList; | 10 import java.util.ArrayList; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 static final int CAMERA_ACCESS_DENIED = 4; | 22 static final int CAMERA_ACCESS_DENIED = 4; |
| 23 static final int MICROPHONE_AND_CAMERA_ACCESS_DENIED = 5; | 23 static final int MICROPHONE_AND_CAMERA_ACCESS_DENIED = 5; |
| 24 static final int MICROPHONE_ACCESS_DENIED = 6; | 24 static final int MICROPHONE_ACCESS_DENIED = 6; |
| 25 | 25 |
| 26 private final WebsiteAddress mAddress; | 26 private final WebsiteAddress mAddress; |
| 27 private final String mTitle; | 27 private final String mTitle; |
| 28 private String mSummary; | 28 private String mSummary; |
| 29 private CameraInfo mCameraInfo; | 29 private CameraInfo mCameraInfo; |
| 30 private CookieInfo mCookieInfo; | 30 private CookieInfo mCookieInfo; |
| 31 private GeolocationInfo mGeolocationInfo; | 31 private GeolocationInfo mGeolocationInfo; |
| 32 private KeygenInfo mKeygenInfo; |
| 32 private MicrophoneInfo mMicrophoneInfo; | 33 private MicrophoneInfo mMicrophoneInfo; |
| 33 private MidiInfo mMidiInfo; | 34 private MidiInfo mMidiInfo; |
| 34 private ContentSettingException mJavaScriptException; | 35 private ContentSettingException mJavaScriptException; |
| 35 private ContentSettingException mPopupException; | 36 private ContentSettingException mPopupException; |
| 36 private ProtectedMediaIdentifierInfo mProtectedMediaIdentifierInfo; | 37 private ProtectedMediaIdentifierInfo mProtectedMediaIdentifierInfo; |
| 37 private PushNotificationInfo mPushNotificationInfo; | 38 private PushNotificationInfo mPushNotificationInfo; |
| 38 private LocalStorageInfo mLocalStorageInfo; | 39 private LocalStorageInfo mLocalStorageInfo; |
| 39 private final List<StorageInfo> mStorageInfo = new ArrayList<StorageInfo>(); | 40 private final List<StorageInfo> mStorageInfo = new ArrayList<StorageInfo>(); |
| 40 private int mStorageInfoCallbacksLeft; | 41 private int mStorageInfoCallbacksLeft; |
| 41 private FullscreenInfo mFullscreenInfo; | 42 private FullscreenInfo mFullscreenInfo; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 /** | 127 /** |
| 127 * Configure geolocation access setting for this site. | 128 * Configure geolocation access setting for this site. |
| 128 */ | 129 */ |
| 129 public void setGeolocationPermission(ContentSetting value) { | 130 public void setGeolocationPermission(ContentSetting value) { |
| 130 if (mGeolocationInfo != null) { | 131 if (mGeolocationInfo != null) { |
| 131 mGeolocationInfo.setContentSetting(value); | 132 mGeolocationInfo.setContentSetting(value); |
| 132 } | 133 } |
| 133 } | 134 } |
| 134 | 135 |
| 135 /** | 136 /** |
| 137 * Sets the KeygenInfo object for this Website. |
| 138 */ |
| 139 public void setKeygenInfo(KeygenInfo info) { |
| 140 mKeygenInfo = info; |
| 141 WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder()); |
| 142 if (embedder != null) { |
| 143 mSummary = embedder.getTitle(); |
| 144 } |
| 145 } |
| 146 |
| 147 public KeygenInfo getKeygenInfo() { |
| 148 return mKeygenInfo; |
| 149 } |
| 150 |
| 151 /** |
| 152 * Returns what permission governs keygen access. |
| 153 */ |
| 154 public ContentSetting getKeygenPermission() { |
| 155 return mKeygenInfo != null ? mKeygenInfo.getContentSetting() : null; |
| 156 } |
| 157 |
| 158 /** |
| 159 * Configure keygen access setting for this site. |
| 160 */ |
| 161 public void setKeygenPermission(ContentSetting value) { |
| 162 if (mKeygenInfo != null) { |
| 163 mKeygenInfo.setContentSetting(value); |
| 164 } |
| 165 } |
| 166 |
| 167 /** |
| 136 * Sets the MidiInfo object for this Website. | 168 * Sets the MidiInfo object for this Website. |
| 137 */ | 169 */ |
| 138 public void setMidiInfo(MidiInfo info) { | 170 public void setMidiInfo(MidiInfo info) { |
| 139 mMidiInfo = info; | 171 mMidiInfo = info; |
| 140 WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder()); | 172 WebsiteAddress embedder = WebsiteAddress.create(info.getEmbedder()); |
| 141 if (embedder != null) { | 173 if (embedder != null) { |
| 142 mSummary = embedder.getTitle(); | 174 mSummary = embedder.getTitle(); |
| 143 } | 175 } |
| 144 } | 176 } |
| 145 | 177 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 * Configure fullscreen setting for this site. | 450 * Configure fullscreen setting for this site. |
| 419 * | 451 * |
| 420 * @param value Content setting for fullscreen permission. | 452 * @param value Content setting for fullscreen permission. |
| 421 */ | 453 */ |
| 422 public void setFullscreenPermission(ContentSetting value) { | 454 public void setFullscreenPermission(ContentSetting value) { |
| 423 if (mFullscreenInfo != null) { | 455 if (mFullscreenInfo != null) { |
| 424 mFullscreenInfo.setContentSetting(value); | 456 mFullscreenInfo.setContentSetting(value); |
| 425 } | 457 } |
| 426 } | 458 } |
| 427 } | 459 } |
| OLD | NEW |