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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java

Issue 1399613002: Public glue layer plumbing for View#startActivityForResult (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 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.app.assist.AssistStructure.ViewNode; 7 import android.app.assist.AssistStructure.ViewNode;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent;
9 import android.content.res.Configuration; 10 import android.content.res.Configuration;
10 import android.graphics.Bitmap; 11 import android.graphics.Bitmap;
11 import android.graphics.Canvas; 12 import android.graphics.Canvas;
12 import android.graphics.Paint; 13 import android.graphics.Paint;
13 import android.graphics.Picture; 14 import android.graphics.Picture;
14 import android.graphics.Rect; 15 import android.graphics.Rect;
15 import android.graphics.drawable.Drawable; 16 import android.graphics.drawable.Drawable;
16 import android.net.Uri; 17 import android.net.Uri;
17 import android.net.http.SslCertificate; 18 import android.net.http.SslCertificate;
18 import android.os.Build; 19 import android.os.Build;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 import org.chromium.android_webview.AwSettings; 54 import org.chromium.android_webview.AwSettings;
54 import org.chromium.base.ThreadUtils; 55 import org.chromium.base.ThreadUtils;
55 import org.chromium.base.annotations.SuppressFBWarnings; 56 import org.chromium.base.annotations.SuppressFBWarnings;
56 import org.chromium.content.browser.SmartClipProvider; 57 import org.chromium.content.browser.SmartClipProvider;
57 import org.chromium.content_public.browser.AccessibilitySnapshotCallback; 58 import org.chromium.content_public.browser.AccessibilitySnapshotCallback;
58 import org.chromium.content_public.browser.AccessibilitySnapshotNode; 59 import org.chromium.content_public.browser.AccessibilitySnapshotNode;
59 import org.chromium.content_public.browser.NavigationHistory; 60 import org.chromium.content_public.browser.NavigationHistory;
60 61
61 import java.io.BufferedWriter; 62 import java.io.BufferedWriter;
62 import java.io.File; 63 import java.io.File;
64 import java.lang.reflect.Method;
63 import java.util.Iterator; 65 import java.util.Iterator;
64 import java.util.Map; 66 import java.util.Map;
65 import java.util.Queue; 67 import java.util.Queue;
66 import java.util.concurrent.Callable; 68 import java.util.concurrent.Callable;
67 import java.util.concurrent.ConcurrentLinkedQueue; 69 import java.util.concurrent.ConcurrentLinkedQueue;
68 import java.util.concurrent.FutureTask; 70 import java.util.concurrent.FutureTask;
69 import java.util.concurrent.TimeUnit; 71 import java.util.concurrent.TimeUnit;
70 72
71 /** 73 /**
72 * This class is the delegate to which WebViewProxy forwards all API calls. 74 * This class is the delegate to which WebViewProxy forwards all API calls.
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1739 @Override 1741 @Override
1740 public void run() { 1742 public void run() {
1741 mAwContents.setLayoutParams(layoutParams); 1743 mAwContents.setLayoutParams(layoutParams);
1742 } 1744 }
1743 }); 1745 });
1744 return; 1746 return;
1745 } 1747 }
1746 mAwContents.setLayoutParams(layoutParams); 1748 mAwContents.setLayoutParams(layoutParams);
1747 } 1749 }
1748 1750
1751 // Overrides WebViewProvider.ViewDelegate.onActivityResult (not in system ap i jar yet).
sgurun-gerrit only 2015/10/16 00:06:53 add this to cleanup crbug.
hush (inactive) 2015/10/20 23:16:09 Done.
1752 public void onActivityResult(final int requestCode, final int resultCode, fi nal Intent data) {
1753 if (checkNeedsPost()) {
1754 mRunQueue.addTask(new Runnable() {
1755 @Override
1756 public void run() {
1757 onActivityResult(requestCode, resultCode, data);
1758 }
1759 });
1760 return;
1761 }
1762 mAwContents.onActivityResult(requestCode, resultCode, data);
1763 }
1764
1749 @Override 1765 @Override
1750 public boolean performLongClick() { 1766 public boolean performLongClick() {
1751 // Return false unless the WebView is attached to a View with a parent 1767 // Return false unless the WebView is attached to a View with a parent
1752 return mWebView.getParent() != null ? mWebViewPrivate.super_performLongC lick() : false; 1768 return mWebView.getParent() != null ? mWebViewPrivate.super_performLongC lick() : false;
1753 } 1769 }
1754 1770
1755 @Override 1771 @Override
1756 public void onConfigurationChanged(final Configuration newConfig) { 1772 public void onConfigurationChanged(final Configuration newConfig) {
1757 if (checkNeedsPost()) { 1773 if (checkNeedsPost()) {
1758 mRunQueue.addTask(new Runnable() { 1774 mRunQueue.addTask(new Runnable() {
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2233 public void super_onConfigurationChanged(Configuration arg0) { 2249 public void super_onConfigurationChanged(Configuration arg0) {
2234 // Intentional no-op 2250 // Intentional no-op
2235 } 2251 }
2236 2252
2237 @Override 2253 @Override
2238 public int super_getScrollBarStyle() { 2254 public int super_getScrollBarStyle() {
2239 return mWebViewPrivate.super_getScrollBarStyle(); 2255 return mWebViewPrivate.super_getScrollBarStyle();
2240 } 2256 }
2241 2257
2242 @Override 2258 @Override
2259 public void super_startActivityForResult(Intent intent, int requestCode) {
2260 // TODO(hush): Use mWebViewPrivate.super_startActivityForResult
2261 // after N release. crbug.com/543272
2262 assert Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
sgurun-gerrit only 2015/10/16 00:06:53 nit: I don't think java asserts are functional.
Torne 2015/10/16 12:49:40 Yeah, don't use asserts, they are off by default b
hush (inactive) 2015/10/20 23:16:09 Ok. I just deleted it.
2263 try {
2264 Method startActivityForResultMethod =
2265 View.class.getMethod("startActivityForResult", Intent.cl ass, int.class);
2266 startActivityForResultMethod.invoke(mWebView, intent, requestCod e);
2267 } catch (Exception e) {
2268 throw new RuntimeException("Invalid reflection", e);
2269 }
2270 }
2271
2272 @Override
2243 public boolean awakenScrollBars() { 2273 public boolean awakenScrollBars() {
2244 mWebViewPrivate.awakenScrollBars(0); 2274 mWebViewPrivate.awakenScrollBars(0);
2245 // TODO: modify the WebView.PrivateAccess to provide a return value. 2275 // TODO: modify the WebView.PrivateAccess to provide a return value.
2246 return true; 2276 return true;
2247 } 2277 }
2248 2278
2249 @Override 2279 @Override
2250 public boolean super_awakenScrollBars(int arg0, boolean arg1) { 2280 public boolean super_awakenScrollBars(int arg0, boolean arg1) {
2251 return false; 2281 return false;
2252 } 2282 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
2288 mAwContents.extractSmartClipData(x, y, width, height); 2318 mAwContents.extractSmartClipData(x, y, width, height);
2289 } 2319 }
2290 2320
2291 // Implements SmartClipProvider 2321 // Implements SmartClipProvider
2292 @Override 2322 @Override
2293 public void setSmartClipResultHandler(final Handler resultHandler) { 2323 public void setSmartClipResultHandler(final Handler resultHandler) {
2294 checkThread(); 2324 checkThread();
2295 mAwContents.setSmartClipResultHandler(resultHandler); 2325 mAwContents.setSmartClipResultHandler(resultHandler);
2296 } 2326 }
2297 } 2327 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698