Loading core/java/android/webkit/WebView.java +30 −13 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.database.DataSetObserver; Loading Loading @@ -59,7 +58,6 @@ import android.os.Message; import android.os.StrictMode; import android.provider.Settings; import android.speech.tts.TextToSpeech; import android.text.TextUtils; import android.util.AttributeSet; import android.util.EventLog; import android.util.Log; Loading Loading @@ -126,7 +124,8 @@ import java.util.regex.Pattern; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import static javax.microedition.khronos.egl.EGL10.*; import static javax.microedition.khronos.egl.EGL10.EGL_DEFAULT_DISPLAY; /** * <p>A View that displays web pages. This class is the basis upon which you Loading Loading @@ -333,6 +332,7 @@ public class WebView extends AbsoluteLayout ViewGroup.OnHierarchyChangeListener { private class InnerGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener { @Override public void onGlobalLayout() { if (isShown()) { setGLRectViewport(); Loading @@ -341,6 +341,7 @@ public class WebView extends AbsoluteLayout } private class InnerScrollChangedListener implements ViewTreeObserver.OnScrollChangedListener { @Override public void onScrollChanged() { if (isShown()) { setGLRectViewport(); Loading Loading @@ -1242,7 +1243,7 @@ public class WebView extends AbsoluteLayout PackageManager pm = mContext.getPackageManager(); for (String name : sGoogleApps) { try { PackageInfo pInfo = pm.getPackageInfo(name, pm.getPackageInfo(name, PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES); installedPackages.add(name); } catch (PackageManager.NameNotFoundException e) { Loading Loading @@ -1414,23 +1415,27 @@ public class WebView extends AbsoluteLayout .setMessage(com.android.internal.R.string.save_password_message) .setPositiveButton(com.android.internal.R.string.save_password_notnow, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { resumeMsg.sendToTarget(); } }) .setNeutralButton(com.android.internal.R.string.save_password_remember, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { remember.sendToTarget(); } }) .setNegativeButton(com.android.internal.R.string.save_password_never, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { neverRemember.sendToTarget(); } }) .setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { resumeMsg.sendToTarget(); } Loading Loading @@ -1516,6 +1521,7 @@ public class WebView extends AbsoluteLayout * * @deprecated This method is now obsolete. */ @Deprecated public int getVisibleTitleHeight() { checkThread(); return getVisibleTitleHeightImpl(); Loading Loading @@ -1854,6 +1860,7 @@ public class WebView extends AbsoluteLayout // contains valid data. final File temp = new File(dest.getPath() + ".writing"); new Thread(new Runnable() { @Override public void run() { FileOutputStream out = null; try { Loading Loading @@ -1923,6 +1930,7 @@ public class WebView extends AbsoluteLayout final FileInputStream in = new FileInputStream(src); final Bundle copy = new Bundle(b); new Thread(new Runnable() { @Override public void run() { try { final Picture p = Picture.createFromStream(in); Loading @@ -1930,6 +1938,7 @@ public class WebView extends AbsoluteLayout // Post a runnable on the main thread to update the // history picture fields. mPrivateHandler.post(new Runnable() { @Override public void run() { restoreHistoryPictureFields(p, copy); } Loading Loading @@ -2658,8 +2667,8 @@ public class WebView extends AbsoluteLayout int slop = viewToContentDimension(mNavSlop); cursorBounds.inset(-slop, -slop); if (cursorBounds.contains(contentX, contentY)) { contentX = (int) cursorBounds.centerX(); contentY = (int) cursorBounds.centerY(); contentX = cursorBounds.centerX(); contentY = cursorBounds.centerY(); } } } Loading Loading @@ -5054,6 +5063,7 @@ public class WebView extends AbsoluteLayout mWebSettings = getSettings(); } @Override public void run() { ArrayList<String> pastEntries = new ArrayList<String>(); Loading Loading @@ -5716,6 +5726,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView no longer needs to implement * ViewGroup.OnHierarchyChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onChildViewAdded(View parent, View child) {} Loading @@ -5724,6 +5735,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView no longer needs to implement * ViewGroup.OnHierarchyChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onChildViewRemoved(View p, View child) {} Loading @@ -5732,6 +5744,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView should not have implemented * ViewTreeObserver.OnGlobalFocusChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onGlobalFocusChanged(View oldFocus, View newFocus) { Loading Loading @@ -6168,9 +6181,10 @@ public class WebView extends AbsoluteLayout } if (DEBUG_TOUCH_HIGHLIGHT) { if (getSettings().getNavDump()) { mTouchHighlightX = (int) x + mScrollX; mTouchHighlightY = (int) y + mScrollY; mTouchHighlightX = x + mScrollX; mTouchHighlightY = y + mScrollY; mPrivateHandler.postDelayed(new Runnable() { @Override public void run() { mTouchHighlightX = mTouchHighlightY = 0; invalidate(); Loading Loading @@ -6762,8 +6776,6 @@ public class WebView extends AbsoluteLayout int oldY = mScrollY; int rangeX = computeMaxScrollX(); int rangeY = computeMaxScrollY(); int overscrollDistance = mOverscrollDistance; // Check for the original scrolling layer in case we change // directions. mTouchMode might be TOUCH_DRAG_MODE if we have // reached the edge of a layer but mScrollingLayer will be non-zero Loading Loading @@ -7476,8 +7488,8 @@ public class WebView extends AbsoluteLayout return false; } mDragFromTextInput = true; event.offsetLocation((float) (mWebTextView.getLeft() - mScrollX), (float) (mWebTextView.getTop() - mScrollY)); event.offsetLocation((mWebTextView.getLeft() - mScrollX), (mWebTextView.getTop() - mScrollY)); boolean result = onTouchEvent(event); mDragFromTextInput = false; return result; Loading Loading @@ -9032,7 +9044,7 @@ public class WebView extends AbsoluteLayout if (position < 0 || position >= getCount()) { return null; } return (Container) getItem(position); return getItem(position); } @Override Loading Loading @@ -9131,6 +9143,7 @@ public class WebView extends AbsoluteLayout } } @Override public void run() { final ListView listView = (ListView) LayoutInflater.from(mContext) .inflate(com.android.internal.R.layout.select_dialog, null); Loading @@ -9141,6 +9154,7 @@ public class WebView extends AbsoluteLayout if (mMultiple) { b.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mWebViewCore.sendMessage( EventHub.LISTBOX_CHOICES, Loading @@ -9149,6 +9163,7 @@ public class WebView extends AbsoluteLayout }}); b.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); Loading @@ -9172,6 +9187,7 @@ public class WebView extends AbsoluteLayout } } else { listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { // Rather than sending the message right away, send it Loading @@ -9192,6 +9208,7 @@ public class WebView extends AbsoluteLayout } } mListBoxDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); Loading core/java/android/webkit/WebViewCore.java +15 −14 Original line number Diff line number Diff line Loading @@ -37,18 +37,14 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.view.SurfaceView; import android.view.View; import android.webkit.DeviceMotionService; import android.webkit.DeviceMotionAndOrientationManager; import android.webkit.DeviceOrientationService; import android.webkit.JniUtil; import junit.framework.Assert; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.Set; import junit.framework.Assert; /** * @hide */ Loading Loading @@ -382,6 +378,7 @@ public final class WebViewCore { mCallbackProxy.onExceededDatabaseQuota(url, databaseIdentifier, currentQuota, estimatedSize, getUsedQuota(), new WebStorage.QuotaUpdater() { @Override public void updateQuota(long quota) { nativeSetNewStorageLimit(quota); } Loading @@ -396,6 +393,7 @@ public final class WebViewCore { protected void reachedMaxAppCacheSize(long spaceNeeded) { mCallbackProxy.onReachedMaxAppCacheSize(spaceNeeded, getUsedQuota(), new WebStorage.QuotaUpdater() { @Override public void updateQuota(long quota) { nativeSetNewStorageLimit(quota); } Loading @@ -404,6 +402,7 @@ public final class WebViewCore { protected void populateVisitedLinks() { ValueCallback callback = new ValueCallback<String[]>() { @Override public void onReceiveValue(String[] value) { sendMessage(EventHub.POPULATE_VISITED_LINKS, (Object)value); } Loading @@ -420,6 +419,7 @@ public final class WebViewCore { protected void geolocationPermissionsShowPrompt(String origin) { mCallbackProxy.onGeolocationPermissionsShowPrompt(origin, new GeolocationPermissions.Callback() { @Override public void invoke(String origin, boolean allow, boolean remember) { GeolocationPermissionsData data = new GeolocationPermissionsData(); data.mOrigin = origin; Loading Loading @@ -677,6 +677,7 @@ public final class WebViewCore { private static final int REDUCE_PRIORITY = 1; private static final int RESUME_PRIORITY = 2; @Override public void run() { Looper.prepare(); Assert.assertNull(sWebCoreHandler); Loading Loading
core/java/android/webkit/WebView.java +30 −13 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.database.DataSetObserver; Loading Loading @@ -59,7 +58,6 @@ import android.os.Message; import android.os.StrictMode; import android.provider.Settings; import android.speech.tts.TextToSpeech; import android.text.TextUtils; import android.util.AttributeSet; import android.util.EventLog; import android.util.Log; Loading Loading @@ -126,7 +124,8 @@ import java.util.regex.Pattern; import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import static javax.microedition.khronos.egl.EGL10.*; import static javax.microedition.khronos.egl.EGL10.EGL_DEFAULT_DISPLAY; /** * <p>A View that displays web pages. This class is the basis upon which you Loading Loading @@ -333,6 +332,7 @@ public class WebView extends AbsoluteLayout ViewGroup.OnHierarchyChangeListener { private class InnerGlobalLayoutListener implements ViewTreeObserver.OnGlobalLayoutListener { @Override public void onGlobalLayout() { if (isShown()) { setGLRectViewport(); Loading @@ -341,6 +341,7 @@ public class WebView extends AbsoluteLayout } private class InnerScrollChangedListener implements ViewTreeObserver.OnScrollChangedListener { @Override public void onScrollChanged() { if (isShown()) { setGLRectViewport(); Loading Loading @@ -1242,7 +1243,7 @@ public class WebView extends AbsoluteLayout PackageManager pm = mContext.getPackageManager(); for (String name : sGoogleApps) { try { PackageInfo pInfo = pm.getPackageInfo(name, pm.getPackageInfo(name, PackageManager.GET_ACTIVITIES | PackageManager.GET_SERVICES); installedPackages.add(name); } catch (PackageManager.NameNotFoundException e) { Loading Loading @@ -1414,23 +1415,27 @@ public class WebView extends AbsoluteLayout .setMessage(com.android.internal.R.string.save_password_message) .setPositiveButton(com.android.internal.R.string.save_password_notnow, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { resumeMsg.sendToTarget(); } }) .setNeutralButton(com.android.internal.R.string.save_password_remember, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { remember.sendToTarget(); } }) .setNegativeButton(com.android.internal.R.string.save_password_never, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { neverRemember.sendToTarget(); } }) .setOnCancelListener(new OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { resumeMsg.sendToTarget(); } Loading Loading @@ -1516,6 +1521,7 @@ public class WebView extends AbsoluteLayout * * @deprecated This method is now obsolete. */ @Deprecated public int getVisibleTitleHeight() { checkThread(); return getVisibleTitleHeightImpl(); Loading Loading @@ -1854,6 +1860,7 @@ public class WebView extends AbsoluteLayout // contains valid data. final File temp = new File(dest.getPath() + ".writing"); new Thread(new Runnable() { @Override public void run() { FileOutputStream out = null; try { Loading Loading @@ -1923,6 +1930,7 @@ public class WebView extends AbsoluteLayout final FileInputStream in = new FileInputStream(src); final Bundle copy = new Bundle(b); new Thread(new Runnable() { @Override public void run() { try { final Picture p = Picture.createFromStream(in); Loading @@ -1930,6 +1938,7 @@ public class WebView extends AbsoluteLayout // Post a runnable on the main thread to update the // history picture fields. mPrivateHandler.post(new Runnable() { @Override public void run() { restoreHistoryPictureFields(p, copy); } Loading Loading @@ -2658,8 +2667,8 @@ public class WebView extends AbsoluteLayout int slop = viewToContentDimension(mNavSlop); cursorBounds.inset(-slop, -slop); if (cursorBounds.contains(contentX, contentY)) { contentX = (int) cursorBounds.centerX(); contentY = (int) cursorBounds.centerY(); contentX = cursorBounds.centerX(); contentY = cursorBounds.centerY(); } } } Loading Loading @@ -5054,6 +5063,7 @@ public class WebView extends AbsoluteLayout mWebSettings = getSettings(); } @Override public void run() { ArrayList<String> pastEntries = new ArrayList<String>(); Loading Loading @@ -5716,6 +5726,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView no longer needs to implement * ViewGroup.OnHierarchyChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onChildViewAdded(View parent, View child) {} Loading @@ -5724,6 +5735,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView no longer needs to implement * ViewGroup.OnHierarchyChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onChildViewRemoved(View p, View child) {} Loading @@ -5732,6 +5744,7 @@ public class WebView extends AbsoluteLayout * @deprecated WebView should not have implemented * ViewTreeObserver.OnGlobalFocusChangeListener. This method does nothing now. */ @Override // Cannot add @hide as this can always be accessed via the interface. @Deprecated public void onGlobalFocusChanged(View oldFocus, View newFocus) { Loading Loading @@ -6168,9 +6181,10 @@ public class WebView extends AbsoluteLayout } if (DEBUG_TOUCH_HIGHLIGHT) { if (getSettings().getNavDump()) { mTouchHighlightX = (int) x + mScrollX; mTouchHighlightY = (int) y + mScrollY; mTouchHighlightX = x + mScrollX; mTouchHighlightY = y + mScrollY; mPrivateHandler.postDelayed(new Runnable() { @Override public void run() { mTouchHighlightX = mTouchHighlightY = 0; invalidate(); Loading Loading @@ -6762,8 +6776,6 @@ public class WebView extends AbsoluteLayout int oldY = mScrollY; int rangeX = computeMaxScrollX(); int rangeY = computeMaxScrollY(); int overscrollDistance = mOverscrollDistance; // Check for the original scrolling layer in case we change // directions. mTouchMode might be TOUCH_DRAG_MODE if we have // reached the edge of a layer but mScrollingLayer will be non-zero Loading Loading @@ -7476,8 +7488,8 @@ public class WebView extends AbsoluteLayout return false; } mDragFromTextInput = true; event.offsetLocation((float) (mWebTextView.getLeft() - mScrollX), (float) (mWebTextView.getTop() - mScrollY)); event.offsetLocation((mWebTextView.getLeft() - mScrollX), (mWebTextView.getTop() - mScrollY)); boolean result = onTouchEvent(event); mDragFromTextInput = false; return result; Loading Loading @@ -9032,7 +9044,7 @@ public class WebView extends AbsoluteLayout if (position < 0 || position >= getCount()) { return null; } return (Container) getItem(position); return getItem(position); } @Override Loading Loading @@ -9131,6 +9143,7 @@ public class WebView extends AbsoluteLayout } } @Override public void run() { final ListView listView = (ListView) LayoutInflater.from(mContext) .inflate(com.android.internal.R.layout.select_dialog, null); Loading @@ -9141,6 +9154,7 @@ public class WebView extends AbsoluteLayout if (mMultiple) { b.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mWebViewCore.sendMessage( EventHub.LISTBOX_CHOICES, Loading @@ -9149,6 +9163,7 @@ public class WebView extends AbsoluteLayout }}); b.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); Loading @@ -9172,6 +9187,7 @@ public class WebView extends AbsoluteLayout } } else { listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View v, int position, long id) { // Rather than sending the message right away, send it Loading @@ -9192,6 +9208,7 @@ public class WebView extends AbsoluteLayout } } mListBoxDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { mWebViewCore.sendMessage( EventHub.SINGLE_LISTBOX_CHOICE, -2, 0); Loading
core/java/android/webkit/WebViewCore.java +15 −14 Original line number Diff line number Diff line Loading @@ -37,18 +37,14 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.view.SurfaceView; import android.view.View; import android.webkit.DeviceMotionService; import android.webkit.DeviceMotionAndOrientationManager; import android.webkit.DeviceOrientationService; import android.webkit.JniUtil; import junit.framework.Assert; import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.Set; import junit.framework.Assert; /** * @hide */ Loading Loading @@ -382,6 +378,7 @@ public final class WebViewCore { mCallbackProxy.onExceededDatabaseQuota(url, databaseIdentifier, currentQuota, estimatedSize, getUsedQuota(), new WebStorage.QuotaUpdater() { @Override public void updateQuota(long quota) { nativeSetNewStorageLimit(quota); } Loading @@ -396,6 +393,7 @@ public final class WebViewCore { protected void reachedMaxAppCacheSize(long spaceNeeded) { mCallbackProxy.onReachedMaxAppCacheSize(spaceNeeded, getUsedQuota(), new WebStorage.QuotaUpdater() { @Override public void updateQuota(long quota) { nativeSetNewStorageLimit(quota); } Loading @@ -404,6 +402,7 @@ public final class WebViewCore { protected void populateVisitedLinks() { ValueCallback callback = new ValueCallback<String[]>() { @Override public void onReceiveValue(String[] value) { sendMessage(EventHub.POPULATE_VISITED_LINKS, (Object)value); } Loading @@ -420,6 +419,7 @@ public final class WebViewCore { protected void geolocationPermissionsShowPrompt(String origin) { mCallbackProxy.onGeolocationPermissionsShowPrompt(origin, new GeolocationPermissions.Callback() { @Override public void invoke(String origin, boolean allow, boolean remember) { GeolocationPermissionsData data = new GeolocationPermissionsData(); data.mOrigin = origin; Loading Loading @@ -677,6 +677,7 @@ public final class WebViewCore { private static final int REDUCE_PRIORITY = 1; private static final int RESUME_PRIORITY = 2; @Override public void run() { Looper.prepare(); Assert.assertNull(sWebCoreHandler); Loading