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.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.content.ComponentCallbacks2; | 10 import android.content.ComponentCallbacks2; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 private boolean mIsWindowVisible; | 299 private boolean mIsWindowVisible; |
300 private boolean mIsAttachedToWindow; | 300 private boolean mIsAttachedToWindow; |
301 // Visiblity state of |mContentViewCore|. | 301 // Visiblity state of |mContentViewCore|. |
302 private boolean mIsContentViewCoreVisible; | 302 private boolean mIsContentViewCoreVisible; |
303 private boolean mIsUpdateVisibilityTaskPending; | 303 private boolean mIsUpdateVisibilityTaskPending; |
304 private Runnable mUpdateVisibilityRunnable; | 304 private Runnable mUpdateVisibilityRunnable; |
305 | 305 |
306 private Bitmap mFavicon; | 306 private Bitmap mFavicon; |
307 private boolean mHasRequestedVisitedHistoryFromClient; | 307 private boolean mHasRequestedVisitedHistoryFromClient; |
308 // Whether this WebView is a popup. | 308 // Whether this WebView is a popup. |
309 private boolean mIsPopupWindow = false; | 309 private boolean mIsPopupWindow; |
310 | 310 |
311 // The base background color, i.e. not accounting for any CSS body from the
current page. | 311 // The base background color, i.e. not accounting for any CSS body from the
current page. |
312 private int mBaseBackgroundColor = Color.WHITE; | 312 private int mBaseBackgroundColor = Color.WHITE; |
313 | 313 |
314 // Must call nativeUpdateLastHitTestData first to update this before use. | 314 // Must call nativeUpdateLastHitTestData first to update this before use. |
315 private final HitTestData mPossiblyStaleHitTestData = new HitTestData(); | 315 private final HitTestData mPossiblyStaleHitTestData = new HitTestData(); |
316 | 316 |
317 private final DefaultVideoPosterRequestHandler mDefaultVideoPosterRequestHan
dler; | 317 private final DefaultVideoPosterRequestHandler mDefaultVideoPosterRequestHan
dler; |
318 | 318 |
319 // Bound method for suppling Picture instances to the AwContentsClient. Will
be null if the | 319 // Bound method for suppling Picture instances to the AwContentsClient. Will
be null if the |
(...skipping 30 matching lines...) Expand all Loading... |
350 | 350 |
351 // The framework may temporarily detach our container view, for example duri
ng layout if | 351 // The framework may temporarily detach our container view, for example duri
ng layout if |
352 // we are a child of a ListView. This may cause many toggles of View focus,
which we suppress | 352 // we are a child of a ListView. This may cause many toggles of View focus,
which we suppress |
353 // when in this state. | 353 // when in this state. |
354 private boolean mTemporarilyDetached; | 354 private boolean mTemporarilyDetached; |
355 | 355 |
356 private Handler mHandler; | 356 private Handler mHandler; |
357 | 357 |
358 // True when this AwContents has been destroyed. | 358 // True when this AwContents has been destroyed. |
359 // Do not use directly, call isDestroyed() instead. | 359 // Do not use directly, call isDestroyed() instead. |
360 private boolean mIsDestroyed = false; | 360 private boolean mIsDestroyed; |
361 | 361 |
362 private static String sCurrentLocales = ""; | 362 private static String sCurrentLocales = ""; |
363 | 363 |
364 private static final class AwContentsDestroyRunnable implements Runnable { | 364 private static final class AwContentsDestroyRunnable implements Runnable { |
365 private final long mNativeAwContents; | 365 private final long mNativeAwContents; |
366 // Hold onto a reference to the window (via its wrapper), so that it is
not destroyed | 366 // Hold onto a reference to the window (via its wrapper), so that it is
not destroyed |
367 // until we are done here. | 367 // until we are done here. |
368 private final WindowAndroidWrapper mWindowAndroid; | 368 private final WindowAndroidWrapper mWindowAndroid; |
369 | 369 |
370 private AwContentsDestroyRunnable( | 370 private AwContentsDestroyRunnable( |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 mOverScrollGlow = null; | 1687 mOverScrollGlow = null; |
1688 } | 1688 } |
1689 } | 1689 } |
1690 | 1690 |
1691 // TODO(mkosiba): In WebViewClassic these appear in some of the scroll exten
t calculation | 1691 // TODO(mkosiba): In WebViewClassic these appear in some of the scroll exten
t calculation |
1692 // methods but toggling them has no visiual effect on the content (in other
words the scrolling | 1692 // methods but toggling them has no visiual effect on the content (in other
words the scrolling |
1693 // code behaves as if the scrollbar-related padding is in place but the onDr
aw code doesn't | 1693 // code behaves as if the scrollbar-related padding is in place but the onDr
aw code doesn't |
1694 // take that into consideration). | 1694 // take that into consideration). |
1695 // http://crbug.com/269032 | 1695 // http://crbug.com/269032 |
1696 private boolean mOverlayHorizontalScrollbar = true; | 1696 private boolean mOverlayHorizontalScrollbar = true; |
1697 private boolean mOverlayVerticalScrollbar = false; | 1697 private boolean mOverlayVerticalScrollbar; |
1698 | 1698 |
1699 /** | 1699 /** |
1700 * @see View#setScrollBarStyle(int) | 1700 * @see View#setScrollBarStyle(int) |
1701 */ | 1701 */ |
1702 public void setScrollBarStyle(int style) { | 1702 public void setScrollBarStyle(int style) { |
1703 if (style == View.SCROLLBARS_INSIDE_OVERLAY | 1703 if (style == View.SCROLLBARS_INSIDE_OVERLAY |
1704 || style == View.SCROLLBARS_OUTSIDE_OVERLAY) { | 1704 || style == View.SCROLLBARS_OUTSIDE_OVERLAY) { |
1705 mOverlayHorizontalScrollbar = mOverlayVerticalScrollbar = true; | 1705 mOverlayHorizontalScrollbar = mOverlayVerticalScrollbar = true; |
1706 } else { | 1706 } else { |
1707 mOverlayHorizontalScrollbar = mOverlayVerticalScrollbar = false; | 1707 mOverlayHorizontalScrollbar = mOverlayVerticalScrollbar = false; |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3375 | 3375 |
3376 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, | 3376 private native void nativePostMessageToFrame(long nativeAwContents, String f
rameId, |
3377 String message, String targetOrigin, int[] msgPorts); | 3377 String message, String targetOrigin, int[] msgPorts); |
3378 | 3378 |
3379 private native void nativeCreateMessageChannel( | 3379 private native void nativeCreateMessageChannel( |
3380 long nativeAwContents, AppWebMessagePort[] ports); | 3380 long nativeAwContents, AppWebMessagePort[] ports); |
3381 | 3381 |
3382 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); | 3382 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC
ontents); |
3383 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); | 3383 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw
Contents); |
3384 } | 3384 } |
OLD | NEW |