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

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

Issue 1745663003: Revert of [Android WebView] Implement support for Network Information API and enable it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 import org.chromium.content_public.browser.GestureStateListener; 62 import org.chromium.content_public.browser.GestureStateListener;
63 import org.chromium.content_public.browser.JavaScriptCallback; 63 import org.chromium.content_public.browser.JavaScriptCallback;
64 import org.chromium.content_public.browser.LoadUrlParams; 64 import org.chromium.content_public.browser.LoadUrlParams;
65 import org.chromium.content_public.browser.NavigationController; 65 import org.chromium.content_public.browser.NavigationController;
66 import org.chromium.content_public.browser.NavigationHistory; 66 import org.chromium.content_public.browser.NavigationHistory;
67 import org.chromium.content_public.browser.WebContents; 67 import org.chromium.content_public.browser.WebContents;
68 import org.chromium.content_public.browser.navigation_controller.LoadURLType; 68 import org.chromium.content_public.browser.navigation_controller.LoadURLType;
69 import org.chromium.content_public.browser.navigation_controller.UserAgentOverri deOption; 69 import org.chromium.content_public.browser.navigation_controller.UserAgentOverri deOption;
70 import org.chromium.content_public.common.Referrer; 70 import org.chromium.content_public.common.Referrer;
71 import org.chromium.net.NetError; 71 import org.chromium.net.NetError;
72 import org.chromium.net.NetworkChangeNotifier;
73 import org.chromium.ui.base.ActivityWindowAndroid; 72 import org.chromium.ui.base.ActivityWindowAndroid;
74 import org.chromium.ui.base.PageTransition; 73 import org.chromium.ui.base.PageTransition;
75 import org.chromium.ui.base.WindowAndroid; 74 import org.chromium.ui.base.WindowAndroid;
76 import org.chromium.ui.gfx.DeviceDisplayInfo; 75 import org.chromium.ui.gfx.DeviceDisplayInfo;
77 76
78 import java.io.File; 77 import java.io.File;
79 import java.lang.annotation.Annotation; 78 import java.lang.annotation.Annotation;
80 import java.net.MalformedURLException; 79 import java.net.MalformedURLException;
81 import java.net.URL; 80 import java.net.URL;
82 import java.util.HashMap; 81 import java.util.HashMap;
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2530 */ 2529 */
2531 public void hideAutofillPopup() { 2530 public void hideAutofillPopup() {
2532 if (TRACE) Log.d(TAG, "hideAutofillPopup"); 2531 if (TRACE) Log.d(TAG, "hideAutofillPopup");
2533 if (mAwAutofillClient != null) { 2532 if (mAwAutofillClient != null) {
2534 mAwAutofillClient.hideAutofillPopup(); 2533 mAwAutofillClient.hideAutofillPopup();
2535 } 2534 }
2536 } 2535 }
2537 2536
2538 public void setNetworkAvailable(boolean networkUp) { 2537 public void setNetworkAvailable(boolean networkUp) {
2539 if (TRACE) Log.d(TAG, "setNetworkAvailable=%s", networkUp); 2538 if (TRACE) Log.d(TAG, "setNetworkAvailable=%s", networkUp);
2540 if (!isDestroyed(WARN)) { 2539 if (!isDestroyed(WARN)) nativeSetJsOnlineProperty(mNativeAwContents, net workUp);
2541 // For backward compatibility when an app uses this API disable the
2542 // Network Information API to prevent inconsistencies,
2543 // see crbug.com/520088.
2544 NetworkChangeNotifier.setAutoDetectConnectivityState(false);
2545 nativeSetJsOnlineProperty(mNativeAwContents, networkUp);
2546 }
2547 } 2540 }
2548 2541
2549 /** 2542 /**
2550 * Inserts a {@link VisualStateCallback}. 2543 * Inserts a {@link VisualStateCallback}.
2551 * 2544 *
2552 * The {@link VisualStateCallback} will be inserted in Blink and will be inv oked when the 2545 * The {@link VisualStateCallback} will be inserted in Blink and will be inv oked when the
2553 * contents of the DOM tree at the moment that the callback was inserted (or later) are drawn 2546 * contents of the DOM tree at the moment that the callback was inserted (or later) are drawn
2554 * into the screen. In other words, the following events need to happen befo re the callback is 2547 * into the screen. In other words, the following events need to happen befo re the callback is
2555 * invoked: 2548 * invoked:
2556 * 1. The DOM tree is committed becoming the pending tree - see ThreadProxy: :BeginMainFrame 2549 * 1. The DOM tree is committed becoming the pending tree - see ThreadProxy: :BeginMainFrame
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 long resources); 3295 long resources);
3303 3296
3304 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId, 3297 private native void nativePostMessageToFrame(long nativeAwContents, String f rameId,
3305 String message, String targetOrigin, int[] msgPorts); 3298 String message, String targetOrigin, int[] msgPorts);
3306 3299
3307 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess agePort[] ports); 3300 private native void nativeCreateMessageChannel(long nativeAwContents, AwMess agePort[] ports);
3308 3301
3309 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents); 3302 private native void nativeGrantFileSchemeAccesstoChildProcess(long nativeAwC ontents);
3310 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw Contents); 3303 private native void nativeResumeLoadingCreatedPopupWebContents(long nativeAw Contents);
3311 } 3304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698