| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.app.Activity; | 8 import android.app.Activity; |
| 9 import android.content.ComponentCallbacks2; | 9 import android.content.ComponentCallbacks2; |
| 10 import android.content.Context; | 10 import android.content.Context; |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 FullScreenView fullScreenView = new FullScreenView(mContext, mAwViewMeth
ods); | 644 FullScreenView fullScreenView = new FullScreenView(mContext, mAwViewMeth
ods); |
| 645 mFullScreenTransitionsState.enterFullScreen(fullScreenView); | 645 mFullScreenTransitionsState.enterFullScreen(fullScreenView); |
| 646 mAwViewMethods = new NullAwViewMethods(this, mInternalAccessAdapter, mCo
ntainerView); | 646 mAwViewMethods = new NullAwViewMethods(this, mInternalAccessAdapter, mCo
ntainerView); |
| 647 mContainerView.removeOnLayoutChangeListener(mLayoutChangeListener); | 647 mContainerView.removeOnLayoutChangeListener(mLayoutChangeListener); |
| 648 fullScreenView.addOnLayoutChangeListener(mLayoutChangeListener); | 648 fullScreenView.addOnLayoutChangeListener(mLayoutChangeListener); |
| 649 | 649 |
| 650 // Associate this AwContents with the FullScreenView. | 650 // Associate this AwContents with the FullScreenView. |
| 651 setInternalAccessAdapter(fullScreenView.getInternalAccessAdapter()); | 651 setInternalAccessAdapter(fullScreenView.getInternalAccessAdapter()); |
| 652 setContainerView(fullScreenView); | 652 setContainerView(fullScreenView); |
| 653 | 653 |
| 654 // Make the background transparent so that the ContentVideoView is visib
le | |
| 655 // behind the FullScreenView. | |
| 656 nativeSetHasTransparentBackground(mNativeAwContents, true); | |
| 657 return fullScreenView; | 654 return fullScreenView; |
| 658 } | 655 } |
| 659 | 656 |
| 660 /** | 657 /** |
| 661 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont
ents} are drawn | 658 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont
ents} are drawn |
| 662 * in the WebView. | 659 * in the WebView. |
| 663 */ | 660 */ |
| 664 void exitFullScreen() { | 661 void exitFullScreen() { |
| 665 assert isFullScreen(); | 662 assert isFullScreen(); |
| 666 | 663 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 678 this, fullscreenView.getInternalAccessAdapter(), fullscreenView)
); | 675 this, fullscreenView.getInternalAccessAdapter(), fullscreenView)
); |
| 679 mAwViewMethods = awViewMethodsImpl; | 676 mAwViewMethods = awViewMethodsImpl; |
| 680 ViewGroup initialContainerView = mFullScreenTransitionsState.getInitialC
ontainerView(); | 677 ViewGroup initialContainerView = mFullScreenTransitionsState.getInitialC
ontainerView(); |
| 681 initialContainerView.addOnLayoutChangeListener(mLayoutChangeListener); | 678 initialContainerView.addOnLayoutChangeListener(mLayoutChangeListener); |
| 682 fullscreenView.removeOnLayoutChangeListener(mLayoutChangeListener); | 679 fullscreenView.removeOnLayoutChangeListener(mLayoutChangeListener); |
| 683 | 680 |
| 684 // Re-associate this AwContents with the WebView. | 681 // Re-associate this AwContents with the WebView. |
| 685 setInternalAccessAdapter(mFullScreenTransitionsState.getInitialInternalA
ccessDelegate()); | 682 setInternalAccessAdapter(mFullScreenTransitionsState.getInitialInternalA
ccessDelegate()); |
| 686 setContainerView(initialContainerView); | 683 setContainerView(initialContainerView); |
| 687 | 684 |
| 688 nativeSetHasTransparentBackground(mNativeAwContents, false); | |
| 689 mFullScreenTransitionsState.exitFullScreen(); | 685 mFullScreenTransitionsState.exitFullScreen(); |
| 690 } | 686 } |
| 691 | 687 |
| 692 private void setInternalAccessAdapter(InternalAccessDelegate internalAccessA
dapter) { | 688 private void setInternalAccessAdapter(InternalAccessDelegate internalAccessA
dapter) { |
| 693 mInternalAccessAdapter = internalAccessAdapter; | 689 mInternalAccessAdapter = internalAccessAdapter; |
| 694 mContentViewCore.setContainerViewInternals(mInternalAccessAdapter); | 690 mContentViewCore.setContainerViewInternals(mInternalAccessAdapter); |
| 695 } | 691 } |
| 696 | 692 |
| 697 private void setContainerView(ViewGroup newContainerView) { | 693 private void setContainerView(ViewGroup newContainerView) { |
| 698 mContainerView = newContainerView; | 694 mContainerView = newContainerView; |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2442 | 2438 |
| 2443 // Returns null if save state fails. | 2439 // Returns null if save state fails. |
| 2444 private native byte[] nativeGetOpaqueState(long nativeAwContents); | 2440 private native byte[] nativeGetOpaqueState(long nativeAwContents); |
| 2445 | 2441 |
| 2446 // Returns false if restore state fails. | 2442 // Returns false if restore state fails. |
| 2447 private native boolean nativeRestoreFromOpaqueState(long nativeAwContents, b
yte[] state); | 2443 private native boolean nativeRestoreFromOpaqueState(long nativeAwContents, b
yte[] state); |
| 2448 | 2444 |
| 2449 private native long nativeReleasePopupAwContents(long nativeAwContents); | 2445 private native long nativeReleasePopupAwContents(long nativeAwContents); |
| 2450 private native void nativeFocusFirstNode(long nativeAwContents); | 2446 private native void nativeFocusFirstNode(long nativeAwContents); |
| 2451 private native void nativeSetBackgroundColor(long nativeAwContents, int colo
r); | 2447 private native void nativeSetBackgroundColor(long nativeAwContents, int colo
r); |
| 2452 private native void nativeSetHasTransparentBackground( | |
| 2453 long nativeAwContents, boolean transparent); | |
| 2454 | 2448 |
| 2455 private native long nativeGetAwDrawGLViewContext(long nativeAwContents); | 2449 private native long nativeGetAwDrawGLViewContext(long nativeAwContents); |
| 2456 private native long nativeCapturePicture(long nativeAwContents, int width, i
nt height); | 2450 private native long nativeCapturePicture(long nativeAwContents, int width, i
nt height); |
| 2457 private native void nativeEnableOnNewPicture(long nativeAwContents, boolean
enabled); | 2451 private native void nativeEnableOnNewPicture(long nativeAwContents, boolean
enabled); |
| 2458 private native void nativeClearView(long nativeAwContents); | 2452 private native void nativeClearView(long nativeAwContents); |
| 2459 private native void nativeSetExtraHeadersForUrl(long nativeAwContents, | 2453 private native void nativeSetExtraHeadersForUrl(long nativeAwContents, |
| 2460 String url, String extraHeaders); | 2454 String url, String extraHeaders); |
| 2461 | 2455 |
| 2462 private native void nativeInvokeGeolocationCallback( | 2456 private native void nativeInvokeGeolocationCallback( |
| 2463 long nativeAwContents, boolean value, String requestingFrame); | 2457 long nativeAwContents, boolean value, String requestingFrame); |
| 2464 | 2458 |
| 2465 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); | 2459 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); |
| 2466 | 2460 |
| 2467 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); | 2461 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); |
| 2468 | 2462 |
| 2469 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); | 2463 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); |
| 2470 | 2464 |
| 2471 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, | 2465 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
| 2472 long resources); | 2466 long resources); |
| 2473 } | 2467 } |
| OLD | NEW |