Backed out changeset 14a43400007e (bug 859683) for robocop failures.

This commit is contained in:
Ryan VanderMeulen 2014-05-06 15:38:28 -04:00
Родитель aa47f718b2
Коммит f0e2260c0b
9 изменённых файлов: 17 добавлений и 48 удалений

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

@ -36,7 +36,6 @@ import org.mozilla.gecko.background.announcements.AnnouncementsBroadcastService;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.favicons.Favicons;
import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.gfx.FullScreenState;
import org.mozilla.gecko.gfx.Layer;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.PluginLayer;
@ -565,14 +564,13 @@ public abstract class GeckoApp
// Local ref to layerView for thread safety
LayerView layerView = mLayerView;
if (layerView != null) {
layerView.setFullScreenState(message.getBoolean("rootElement")
? FullScreenState.ROOT_ELEMENT : FullScreenState.NON_ROOT_ELEMENT);
layerView.setFullScreen(true);
}
} else if (event.equals("DOMFullScreen:Stop")) {
// Local ref to layerView for thread safety
LayerView layerView = mLayerView;
if (layerView != null) {
layerView.setFullScreenState(FullScreenState.NONE);
layerView.setFullScreen(false);
}
} else if (event.equals("Permissions:Data")) {
String host = message.getString("host");

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

@ -1,12 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko.gfx;
public enum FullScreenState {
NONE,
ROOT_ELEMENT,
NON_ROOT_ELEMENT
}

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

@ -801,8 +801,8 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
/** Implementation of PanZoomTarget */
@Override
public FullScreenState getFullScreenState() {
return mView.getFullScreenState();
public boolean isFullScreen() {
return mView.isFullScreen();
}
/** Implementation of PanZoomTarget */

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

@ -469,11 +469,8 @@ class JavaPanZoomController
return false;
case TOUCHING:
// Don't allow panning if there is a non-root element in full-screen mode. See bug 775511 and bug 859683.
if (mTarget.getFullScreenState() == FullScreenState.NON_ROOT_ELEMENT && !mSubscroller.scrolling()) {
return false;
}
if (panDistance(event) < PAN_THRESHOLD) {
// Don't allow panning if there is an element in full-screen mode. See bug 775511.
if ((mTarget.isFullScreen() && !mSubscroller.scrolling()) || panDistance(event) < PAN_THRESHOLD) {
return false;
}
cancelTouch();
@ -1176,7 +1173,7 @@ class JavaPanZoomController
@Override
public boolean onScale(SimpleScaleGestureDetector detector) {
if (mTarget.getFullScreenState() != FullScreenState.NONE)
if (mTarget.isFullScreen())
return false;
if (mState != PanZoomState.PINCHING)

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

@ -504,11 +504,9 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
// Run through pre-render tasks
runRenderTasks(mTasks, false, mFrameStartTime);
boolean hideScrollbars = (mView.getFullScreenState() == FullScreenState.NON_ROOT_ELEMENT);
if (!mPageContext.fuzzyEquals(mLastPageContext) && !hideScrollbars) {
if (!mPageContext.fuzzyEquals(mLastPageContext) && !mView.isFullScreen()) {
// The viewport or page changed, so show the scrollbars again
// as per UX decision. Don't do this if we're disabling scrolling due to
// full-screen mode though.
// as per UX decision. Don't do this if we're in full-screen mode though.
mVertScrollLayer.unfade();
mHorizScrollLayer.unfade();
mFadeRunnable.scheduleStartFade(ScrollbarLayer.FADE_DELAY);

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

@ -64,7 +64,7 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
/* Must be a PAINT_xxx constant */
private int mPaintState;
private int mBackgroundColor;
private FullScreenState mFullScreenState;
private boolean mFullScreen;
private SurfaceView mSurfaceView;
private TextureView mTextureView;
@ -692,16 +692,12 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
GeckoAccessibility.onLayerViewFocusChanged(this, gainFocus);
}
public void setFullScreenState(FullScreenState state) {
mFullScreenState = state;
public void setFullScreen(boolean fullScreen) {
mFullScreen = fullScreen;
}
public boolean isFullScreen() {
return mFullScreenState != FullScreenState.NONE;
}
public FullScreenState getFullScreenState() {
return mFullScreenState;
return mFullScreen;
}
@Override

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

@ -13,7 +13,7 @@ import android.graphics.RectF;
public interface PanZoomTarget {
public ImmutableViewportMetrics getViewportMetrics();
public ZoomConstraints getZoomConstraints();
public FullScreenState getFullScreenState();
public boolean isFullScreen();
public RectF getMaxMargins();
public void setAnimationTarget(ImmutableViewportMetrics viewport);

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

@ -199,7 +199,6 @@ gbjar.sources += [
'gfx/DisplayPortMetrics.java',
'gfx/DrawTimingQueue.java',
'gfx/FloatSize.java',
'gfx/FullScreenState.java',
'gfx/GeckoLayerClient.java',
'gfx/GLController.java',
'gfx/ImmutableViewportMetrics.java',

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

@ -346,19 +346,12 @@ var BrowserApp = {
});
}, false);
window.addEventListener("mozfullscreenchange", function(e) {
// This event gets fired on the document and its entire ancestor chain
// of documents. When enabling fullscreen, it is fired on the top-level
// document first and goes down; when disabling the order is reversed
// (per spec). This means the last event on enabling will be for the innermost
// document, which will have mozFullScreenElement set correctly.
let doc = e.target;
window.addEventListener("mozfullscreenchange", function() {
sendMessageToJava({
type: doc.mozFullScreen ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
rootElement: (doc.mozFullScreen && doc.mozFullScreenElement == doc.documentElement)
type: document.mozFullScreen ? "DOMFullScreen:Start" : "DOMFullScreen:Stop"
});
if (doc.mozFullScreen)
if (document.mozFullScreen)
showFullScreenWarning();
}, false);