зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset d25a5921d961 (bug 1369815)
This commit is contained in:
Родитель
60327aca51
Коммит
6d278c7bee
|
@ -22,24 +22,6 @@ public final class GeckoViewSettings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum DisplayMode {
|
|
||||||
// This needs to match nsIDocShell.idl
|
|
||||||
BROWSER(0),
|
|
||||||
MINIMAL_UI(1),
|
|
||||||
STANDALONE(2),
|
|
||||||
FULLSCREEN(3);
|
|
||||||
|
|
||||||
private final int mMode;
|
|
||||||
|
|
||||||
DisplayMode(int mode) {
|
|
||||||
mMode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int value() {
|
|
||||||
return mMode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Key to enabled and disable tracking protection.
|
* Key to enabled and disable tracking protection.
|
||||||
*/
|
*/
|
||||||
|
@ -50,13 +32,6 @@ public final class GeckoViewSettings {
|
||||||
*/
|
*/
|
||||||
public static final Key<Boolean> USE_PRIVATE_MODE =
|
public static final Key<Boolean> USE_PRIVATE_MODE =
|
||||||
new Key<Boolean>("usePrivateMode");
|
new Key<Boolean>("usePrivateMode");
|
||||||
|
|
||||||
/*
|
|
||||||
* Key to specify which display-mode we should use
|
|
||||||
*/
|
|
||||||
public static final Key<Boolean> USE_DISPLAY_MODE =
|
|
||||||
new Key<Boolean>("useDisplayMode");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Key to enabled and disable multiprocess browsing (e10s).
|
* Key to enabled and disable multiprocess browsing (e10s).
|
||||||
* Note: can only be set during GeckoView initialization, changes during an
|
* Note: can only be set during GeckoView initialization, changes during an
|
||||||
|
@ -103,23 +78,6 @@ public final class GeckoViewSettings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInt(final Key<Boolean> key, int value) {
|
|
||||||
synchronized (mBundle) {
|
|
||||||
final Object old = mBundle.get(key.text);
|
|
||||||
if (old != null && old.equals(value)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mBundle.putInt(key.text, value);
|
|
||||||
}
|
|
||||||
dispatchUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getInt(final Key<Boolean> key) {
|
|
||||||
synchronized (mBundle) {
|
|
||||||
return mBundle.getInt(key.text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* package */ GeckoBundle asBundle() {
|
/* package */ GeckoBundle asBundle() {
|
||||||
return mBundle;
|
return mBundle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
init() {
|
init() {
|
||||||
this._isSafeBrowsingInit = false;
|
this._isSafeBrowsingInit = false;
|
||||||
this._useTrackingProtection = false;
|
this._useTrackingProtection = false;
|
||||||
this._displayMode = Ci.nsIDocShell.DISPLAY_MODE_BROWSER;
|
|
||||||
|
|
||||||
// We only allow to set this setting during initialization, further updates
|
// We only allow to set this setting during initialization, further updates
|
||||||
// will be ignored.
|
// will be ignored.
|
||||||
|
@ -39,7 +38,6 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
debug("onSettingsUpdate: " + JSON.stringify(this.settings));
|
debug("onSettingsUpdate: " + JSON.stringify(this.settings));
|
||||||
|
|
||||||
this.useTrackingProtection = !!this.settings.useTrackingProtection;
|
this.useTrackingProtection = !!this.settings.useTrackingProtection;
|
||||||
this.useDisplayMode = this.settings.useDisplayMode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get useTrackingProtection() {
|
get useTrackingProtection() {
|
||||||
|
@ -52,8 +50,8 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
this._isSafeBrowsingInit = true;
|
this._isSafeBrowsingInit = true;
|
||||||
}
|
}
|
||||||
if (aUse != this._useTrackingProtection) {
|
if (aUse != this._useTrackingProtection) {
|
||||||
this.messageManager.loadFrameScript('data:,' +
|
this.messageManager.loadFrameScript("data:," +
|
||||||
`docShell.useTrackingProtection = ${aUse}`,
|
"docShell.useTrackingProtection = " + aUse,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
this._useTrackingProtection = aUse;
|
this._useTrackingProtection = aUse;
|
||||||
|
@ -77,27 +75,5 @@ class GeckoViewSettings extends GeckoViewModule {
|
||||||
this.browser.removeAttribute("remote");
|
this.browser.removeAttribute("remote");
|
||||||
}
|
}
|
||||||
parentNode.appendChild(this.browser);
|
parentNode.appendChild(this.browser);
|
||||||
|
|
||||||
// Re-set the display mode, as we probably need to set it on
|
|
||||||
// a different docshell now
|
|
||||||
this.useDisplayMode = this.useDisplayMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
get useDisplayMode() {
|
|
||||||
return this._displayMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
set useDisplayMode(aMode) {
|
|
||||||
if (!this.useMultiprocess) {
|
|
||||||
this.window.QueryInterface(Ci.nsIInterfaceRequestor)
|
|
||||||
.getInterface(Ci.nsIDocShell)
|
|
||||||
.displayMode = aMode;
|
|
||||||
} else {
|
|
||||||
this.messageManager.loadFrameScript('data:,' +
|
|
||||||
`docShell.displayMode = ${aMode}`,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
this._displayMode = aMode;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче