Backed out changeset d25a5921d961 (bug 1369815)

This commit is contained in:
Sebastian Hengst 2017-08-15 18:30:23 +02:00
Родитель 60327aca51
Коммит 6d278c7bee
2 изменённых файлов: 2 добавлений и 68 удалений

Просмотреть файл

@ -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.
*/
@ -50,13 +32,6 @@ public final class GeckoViewSettings {
*/
public static final Key<Boolean> USE_PRIVATE_MODE =
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).
* 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() {
return mBundle;
}

Просмотреть файл

@ -28,7 +28,6 @@ class GeckoViewSettings extends GeckoViewModule {
init() {
this._isSafeBrowsingInit = false;
this._useTrackingProtection = false;
this._displayMode = Ci.nsIDocShell.DISPLAY_MODE_BROWSER;
// We only allow to set this setting during initialization, further updates
// will be ignored.
@ -39,7 +38,6 @@ class GeckoViewSettings extends GeckoViewModule {
debug("onSettingsUpdate: " + JSON.stringify(this.settings));
this.useTrackingProtection = !!this.settings.useTrackingProtection;
this.useDisplayMode = this.settings.useDisplayMode;
}
get useTrackingProtection() {
@ -52,8 +50,8 @@ class GeckoViewSettings extends GeckoViewModule {
this._isSafeBrowsingInit = true;
}
if (aUse != this._useTrackingProtection) {
this.messageManager.loadFrameScript('data:,' +
`docShell.useTrackingProtection = ${aUse}`,
this.messageManager.loadFrameScript("data:," +
"docShell.useTrackingProtection = " + aUse,
true
);
this._useTrackingProtection = aUse;
@ -77,27 +75,5 @@ class GeckoViewSettings extends GeckoViewModule {
this.browser.removeAttribute("remote");
}
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;
}
}