Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: android_webview/java/src/org/chromium/android_webview/AwContents.java

Issue 501093007: [aw] Fix crash when "misbehave" app exits fullscreen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 setContainerView(fullScreenView); 656 setContainerView(fullScreenView);
657 657
658 return fullScreenView; 658 return fullScreenView;
659 } 659 }
660 660
661 /** 661 /**
662 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont ents} are drawn 662 * Returns this {@link AwContents} to embedded mode, where the {@link AwCont ents} are drawn
663 * in the WebView. 663 * in the WebView.
664 */ 664 */
665 void exitFullScreen() { 665 void exitFullScreen() {
666 assert isFullScreen(); 666 if (!isFullScreen())
667 // exitFullScreen() can be called without a prior call to enterFullS creen() if a
668 // "misbehave" app overrides onShowCustomView but does not add the c ustom view to
669 // the window. Exiting avoids a crash.
670 return;
667 671
668 // Detach to tear down the GL functor if this is still associated with t he old 672 // Detach to tear down the GL functor if this is still associated with t he old
669 // container view. It will be recreated during the next call to onDraw a ttached to 673 // container view. It will be recreated during the next call to onDraw a ttached to
670 // the new container view. 674 // the new container view.
671 // NOTE: we cannot use mAwViewMethods here because its type is NullAwVie wMethods. 675 // NOTE: we cannot use mAwViewMethods here because its type is NullAwVie wMethods.
672 AwViewMethods awViewMethodsImpl = mFullScreenTransitionsState.getInitial AwViewMethods(); 676 AwViewMethods awViewMethodsImpl = mFullScreenTransitionsState.getInitial AwViewMethods();
673 awViewMethodsImpl.onDetachedFromWindow(); 677 awViewMethodsImpl.onDetachedFromWindow();
674 678
675 // Swap the view delegates. In embedded mode the FullScreenView owns a 679 // Swap the view delegates. In embedded mode the FullScreenView owns a
676 // NullAwViewMethods and AwContents the AwViewMethodsImpl. 680 // NullAwViewMethods and AwContents the AwViewMethodsImpl.
(...skipping 1823 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 2504
2501 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean networkUp); 2505 private native void nativeSetJsOnlineProperty(long nativeAwContents, boolean networkUp);
2502 2506
2503 private native void nativeTrimMemory(long nativeAwContents, int level, boole an visible); 2507 private native void nativeTrimMemory(long nativeAwContents, int level, boole an visible);
2504 2508
2505 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo rter awPdfExporter); 2509 private native void nativeCreatePdfExporter(long nativeAwContents, AwPdfExpo rter awPdfExporter);
2506 2510
2507 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin, 2511 private native void nativePreauthorizePermission(long nativeAwContents, Stri ng origin,
2508 long resources); 2512 long resources);
2509 } 2513 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698