| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 com.android.webview.chromium; | 5 package com.android.webview.chromium; |
| 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.content.Context; | 9 import android.content.Context; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 @Override | 1688 @Override |
| 1689 public void run() { | 1689 public void run() { |
| 1690 mAwContents.setLayoutParams(layoutParams); | 1690 mAwContents.setLayoutParams(layoutParams); |
| 1691 } | 1691 } |
| 1692 }); | 1692 }); |
| 1693 return; | 1693 return; |
| 1694 } | 1694 } |
| 1695 mAwContents.setLayoutParams(layoutParams); | 1695 mAwContents.setLayoutParams(layoutParams); |
| 1696 } | 1696 } |
| 1697 | 1697 |
| 1698 // Overrides WebViewProvider.ViewDelegate.onActivityResult (not in system ap
i jar yet). | 1698 @Override |
| 1699 // crbug.com/543272. | |
| 1700 public void onActivityResult(final int requestCode, final int resultCode, fi
nal Intent data) { | 1699 public void onActivityResult(final int requestCode, final int resultCode, fi
nal Intent data) { |
| 1701 if (checkNeedsPost()) { | 1700 if (checkNeedsPost()) { |
| 1702 mFactory.addTask(new Runnable() { | 1701 mFactory.addTask(new Runnable() { |
| 1703 @Override | 1702 @Override |
| 1704 public void run() { | 1703 public void run() { |
| 1705 onActivityResult(requestCode, resultCode, data); | 1704 onActivityResult(requestCode, resultCode, data); |
| 1706 } | 1705 } |
| 1707 }); | 1706 }); |
| 1708 return; | 1707 return; |
| 1709 } | 1708 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1723 @Override | 1722 @Override |
| 1724 public void run() { | 1723 public void run() { |
| 1725 onConfigurationChanged(newConfig); | 1724 onConfigurationChanged(newConfig); |
| 1726 } | 1725 } |
| 1727 }); | 1726 }); |
| 1728 return; | 1727 return; |
| 1729 } | 1728 } |
| 1730 mAwContents.onConfigurationChanged(newConfig); | 1729 mAwContents.onConfigurationChanged(newConfig); |
| 1731 } | 1730 } |
| 1732 | 1731 |
| 1733 //TODO(hush): add override after release. | 1732 @Override |
| 1734 //@Override | |
| 1735 public boolean onDragEvent(final DragEvent event) { | 1733 public boolean onDragEvent(final DragEvent event) { |
| 1736 mFactory.startYourEngines(false); | 1734 mFactory.startYourEngines(false); |
| 1737 if (checkNeedsPost()) { | 1735 if (checkNeedsPost()) { |
| 1738 boolean ret = mFactory.runOnUiThreadBlocking(new Callable<Boolean>()
{ | 1736 boolean ret = mFactory.runOnUiThreadBlocking(new Callable<Boolean>()
{ |
| 1739 @Override | 1737 @Override |
| 1740 public Boolean call() { | 1738 public Boolean call() { |
| 1741 return onDragEvent(event); | 1739 return onDragEvent(event); |
| 1742 } | 1740 } |
| 1743 }); | 1741 }); |
| 1744 return ret; | 1742 return ret; |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 // Intentional no-op | 2204 // Intentional no-op |
| 2207 } | 2205 } |
| 2208 | 2206 |
| 2209 @Override | 2207 @Override |
| 2210 public int super_getScrollBarStyle() { | 2208 public int super_getScrollBarStyle() { |
| 2211 return mWebViewPrivate.super_getScrollBarStyle(); | 2209 return mWebViewPrivate.super_getScrollBarStyle(); |
| 2212 } | 2210 } |
| 2213 | 2211 |
| 2214 @Override | 2212 @Override |
| 2215 public void super_startActivityForResult(Intent intent, int requestCode)
{ | 2213 public void super_startActivityForResult(Intent intent, int requestCode)
{ |
| 2216 // TODO(hush): Use mWebViewPrivate.super_startActivityForResult | 2214 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| 2217 // after N release. crbug.com/543272. | 2215 mWebViewPrivate.super_startActivityForResult(intent, requestCode
); |
| 2218 try { | 2216 } else { |
| 2219 Method startActivityForResultMethod = | 2217 try { |
| 2220 View.class.getMethod("startActivityForResult", Intent.cl
ass, int.class); | 2218 Method startActivityForResultMethod = |
| 2221 startActivityForResultMethod.invoke(mWebView, intent, requestCod
e); | 2219 View.class.getMethod("startActivityForResult", Inten
t.class, int.class); |
| 2222 } catch (Exception e) { | 2220 startActivityForResultMethod.invoke(mWebView, intent, reques
tCode); |
| 2223 throw new RuntimeException("Invalid reflection", e); | 2221 } catch (Exception e) { |
| 2222 throw new RuntimeException("Invalid reflection", e); |
| 2223 } |
| 2224 } | 2224 } |
| 2225 } | 2225 } |
| 2226 | 2226 |
| 2227 @Override | 2227 @Override |
| 2228 public boolean awakenScrollBars() { | 2228 public boolean awakenScrollBars() { |
| 2229 mWebViewPrivate.awakenScrollBars(0); | 2229 mWebViewPrivate.awakenScrollBars(0); |
| 2230 // TODO: modify the WebView.PrivateAccess to provide a return value. | 2230 // TODO: modify the WebView.PrivateAccess to provide a return value. |
| 2231 return true; | 2231 return true; |
| 2232 } | 2232 } |
| 2233 | 2233 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2273 mAwContents.extractSmartClipData(x, y, width, height); | 2273 mAwContents.extractSmartClipData(x, y, width, height); |
| 2274 } | 2274 } |
| 2275 | 2275 |
| 2276 // Implements SmartClipProvider | 2276 // Implements SmartClipProvider |
| 2277 @Override | 2277 @Override |
| 2278 public void setSmartClipResultHandler(final Handler resultHandler) { | 2278 public void setSmartClipResultHandler(final Handler resultHandler) { |
| 2279 checkThread(); | 2279 checkThread(); |
| 2280 mAwContents.setSmartClipResultHandler(resultHandler); | 2280 mAwContents.setSmartClipResultHandler(resultHandler); |
| 2281 } | 2281 } |
| 2282 } | 2282 } |
| OLD | NEW |