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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 mContentsClient = contentsClient; | 574 mContentsClient = contentsClient; |
575 mAwViewMethods = new AwViewMethodsImpl(); | 575 mAwViewMethods = new AwViewMethodsImpl(); |
576 mFullScreenTransitionsState = new FullScreenTransitionsState( | 576 mFullScreenTransitionsState = new FullScreenTransitionsState( |
577 mContainerView, mInternalAccessAdapter, mAwViewMethods); | 577 mContainerView, mInternalAccessAdapter, mAwViewMethods); |
578 mContentViewClient = new AwContentViewClient(contentsClient, settings, t
his, mContext); | 578 mContentViewClient = new AwContentViewClient(contentsClient, settings, t
his, mContext); |
579 mLayoutSizer = dependencyFactory.createLayoutSizer(); | 579 mLayoutSizer = dependencyFactory.createLayoutSizer(); |
580 mSettings = settings; | 580 mSettings = settings; |
581 mDIPScale = DeviceDisplayInfo.create(mContext).getDIPScale(); | 581 mDIPScale = DeviceDisplayInfo.create(mContext).getDIPScale(); |
582 mLayoutSizer.setDelegate(new AwLayoutSizerDelegate()); | 582 mLayoutSizer.setDelegate(new AwLayoutSizerDelegate()); |
583 mLayoutSizer.setDIPScale(mDIPScale); | 583 mLayoutSizer.setDIPScale(mDIPScale); |
584 mWebContentsDelegate = new AwWebContentsDelegateAdapter(this, contentsCl
ient, | 584 mWebContentsDelegate = new AwWebContentsDelegateAdapter( |
585 mContainerView, mContext); | 585 this, contentsClient, mContentViewClient, mContext, mContainerVi
ew); |
586 mContentsClientBridge = new AwContentsClientBridge(contentsClient, | 586 mContentsClientBridge = new AwContentsClientBridge(contentsClient, |
587 mBrowserContext.getKeyStore(), AwContentsStatics.getClientCertLo
okupTable()); | 587 mBrowserContext.getKeyStore(), AwContentsStatics.getClientCertLo
okupTable()); |
588 mZoomControls = new AwZoomControls(this); | 588 mZoomControls = new AwZoomControls(this); |
589 mIoThreadClient = new IoThreadClientImpl(); | 589 mIoThreadClient = new IoThreadClientImpl(); |
590 mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl(); | 590 mInterceptNavigationDelegate = new InterceptNavigationDelegateImpl(); |
591 | 591 |
592 AwSettings.ZoomSupportChangeListener zoomListener = | 592 AwSettings.ZoomSupportChangeListener zoomListener = |
593 new AwSettings.ZoomSupportChangeListener() { | 593 new AwSettings.ZoomSupportChangeListener() { |
594 @Override | 594 @Override |
595 public void onGestureZoomSupportChanged( | 595 public void onGestureZoomSupportChanged( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 fullScreenView.addOnLayoutChangeListener(mLayoutChangeListener); | 661 fullScreenView.addOnLayoutChangeListener(mLayoutChangeListener); |
662 | 662 |
663 // Associate this AwContents with the FullScreenView. | 663 // Associate this AwContents with the FullScreenView. |
664 setInternalAccessAdapter(fullScreenView.getInternalAccessAdapter()); | 664 setInternalAccessAdapter(fullScreenView.getInternalAccessAdapter()); |
665 setContainerView(fullScreenView); | 665 setContainerView(fullScreenView); |
666 | 666 |
667 return fullScreenView; | 667 return fullScreenView; |
668 } | 668 } |
669 | 669 |
670 /** | 670 /** |
| 671 * Called when the app has requested to exit fullscreen. |
| 672 */ |
| 673 void requestExitFullscreen() { |
| 674 mContentViewCore.getWebContents().exitFullscreen(); |
| 675 } |
| 676 |
| 677 /** |
671 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont
ents} are drawn | 678 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont
ents} are drawn |
672 * in the WebView. | 679 * in the WebView. |
673 */ | 680 */ |
674 void exitFullScreen() { | 681 void exitFullScreen() { |
675 if (!isFullScreen() || isDestroyed()) | 682 if (!isFullScreen() || isDestroyed()) |
676 // exitFullScreen() can be called without a prior call to enterFullS
creen() if a | 683 // exitFullScreen() can be called without a prior call to enterFullS
creen() if a |
677 // "misbehave" app overrides onShowCustomView but does not add the c
ustom view to | 684 // "misbehave" app overrides onShowCustomView but does not add the c
ustom view to |
678 // the window. Exiting avoids a crash. | 685 // the window. Exiting avoids a crash. |
679 return; | 686 return; |
680 | 687 |
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 | 2555 |
2549 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); | 2556 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean
networkUp); |
2550 | 2557 |
2551 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); | 2558 private native void nativeTrimMemory(long nativeAwContents, int level, boole
an visible); |
2552 | 2559 |
2553 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); | 2560 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo
rter awPdfExporter); |
2554 | 2561 |
2555 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, | 2562 private native void nativePreauthorizePermission(long nativeAwContents, Stri
ng origin, |
2556 long resources); | 2563 long resources); |
2557 } | 2564 } |
OLD | NEW |