Chromium Code Reviews| 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.app.assist.AssistStructure.ViewNode; | 8 import android.app.assist.AssistStructure.ViewNode; |
| 8 import android.content.Context; | 9 import android.content.Context; |
| 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; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 | 71 |
| 71 /** | 72 /** |
| 72 * This class is the delegate to which WebViewProxy forwards all API calls. | 73 * This class is the delegate to which WebViewProxy forwards all API calls. |
| 73 * | 74 * |
| 74 * Most of the actual functionality is implemented by AwContents (or ContentView Core within | 75 * Most of the actual functionality is implemented by AwContents (or ContentView Core within |
| 75 * it). This class also contains WebView-specific APIs that require the creation of other | 76 * it). This class also contains WebView-specific APIs that require the creation of other |
| 76 * adapters (otherwise org.chromium.content would depend on the webview.chromium package) | 77 * adapters (otherwise org.chromium.content would depend on the webview.chromium package) |
| 77 * and a small set of no-op deprecated APIs. | 78 * and a small set of no-op deprecated APIs. |
| 78 */ | 79 */ |
| 79 @SuppressWarnings("deprecation") | 80 @SuppressWarnings("deprecation") |
| 81 @SuppressLint("NewApi") | |
|
newt (away)
2015/10/13 20:41:38
What NewApi warnings are you suppressing? NewApi i
michaelbai
2015/10/13 21:40:15
Done.
| |
| 80 class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate , | 82 class WebViewChromium implements WebViewProvider, WebViewProvider.ScrollDelegate , |
| 81 WebViewProvider.ViewDelegate, SmartClipProvider { | 83 WebViewProvider.ViewDelegate, SmartClipProvider { |
| 82 private class WebViewChromiumRunQueue { | 84 private class WebViewChromiumRunQueue { |
| 83 public WebViewChromiumRunQueue() { | 85 public WebViewChromiumRunQueue() { |
| 84 mQueue = new ConcurrentLinkedQueue<Runnable>(); | 86 mQueue = new ConcurrentLinkedQueue<Runnable>(); |
| 85 } | 87 } |
| 86 | 88 |
| 87 public void addTask(Runnable task) { | 89 public void addTask(Runnable task) { |
| 88 mQueue.add(task); | 90 mQueue.add(task); |
| 89 if (mFactory.hasStarted()) { | 91 if (mFactory.hasStarted()) { |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1705 public void run() { | 1707 public void run() { |
| 1706 onWindowVisibilityChanged(visibility); | 1708 onWindowVisibilityChanged(visibility); |
| 1707 } | 1709 } |
| 1708 }); | 1710 }); |
| 1709 return; | 1711 return; |
| 1710 } | 1712 } |
| 1711 mAwContents.onWindowVisibilityChanged(visibility); | 1713 mAwContents.onWindowVisibilityChanged(visibility); |
| 1712 } | 1714 } |
| 1713 | 1715 |
| 1714 @Override | 1716 @Override |
| 1717 @SuppressLint("DrawAllocation") | |
| 1715 public void onDraw(final Canvas canvas) { | 1718 public void onDraw(final Canvas canvas) { |
| 1716 mFactory.startYourEngines(true); | 1719 mFactory.startYourEngines(true); |
| 1717 if (checkNeedsPost()) { | 1720 if (checkNeedsPost()) { |
| 1718 runVoidTaskOnUiThreadBlocking(new Runnable() { | 1721 runVoidTaskOnUiThreadBlocking(new Runnable() { |
| 1719 @Override | 1722 @Override |
| 1720 public void run() { | 1723 public void run() { |
| 1721 onDraw(canvas); | 1724 onDraw(canvas); |
| 1722 } | 1725 } |
| 1723 }); | 1726 }); |
| 1724 return; | 1727 return; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2001 return requestFocus(direction, previouslyFocusedRect); | 2004 return requestFocus(direction, previouslyFocusedRect); |
| 2002 } | 2005 } |
| 2003 }); | 2006 }); |
| 2004 return ret; | 2007 return ret; |
| 2005 } | 2008 } |
| 2006 mAwContents.requestFocus(); | 2009 mAwContents.requestFocus(); |
| 2007 return mWebViewPrivate.super_requestFocus(direction, previouslyFocusedRe ct); | 2010 return mWebViewPrivate.super_requestFocus(direction, previouslyFocusedRe ct); |
| 2008 } | 2011 } |
| 2009 | 2012 |
| 2010 @Override | 2013 @Override |
| 2014 @SuppressLint("DrawAllocation") | |
| 2011 public void onMeasure(final int widthMeasureSpec, final int heightMeasureSpe c) { | 2015 public void onMeasure(final int widthMeasureSpec, final int heightMeasureSpe c) { |
| 2012 mFactory.startYourEngines(false); | 2016 mFactory.startYourEngines(false); |
| 2013 if (checkNeedsPost()) { | 2017 if (checkNeedsPost()) { |
| 2014 runVoidTaskOnUiThreadBlocking(new Runnable() { | 2018 runVoidTaskOnUiThreadBlocking(new Runnable() { |
| 2015 @Override | 2019 @Override |
| 2016 public void run() { | 2020 public void run() { |
| 2017 onMeasure(widthMeasureSpec, heightMeasureSpec); | 2021 onMeasure(widthMeasureSpec, heightMeasureSpec); |
| 2018 } | 2022 } |
| 2019 }); | 2023 }); |
| 2020 return; | 2024 return; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2288 mAwContents.extractSmartClipData(x, y, width, height); | 2292 mAwContents.extractSmartClipData(x, y, width, height); |
| 2289 } | 2293 } |
| 2290 | 2294 |
| 2291 // Implements SmartClipProvider | 2295 // Implements SmartClipProvider |
| 2292 @Override | 2296 @Override |
| 2293 public void setSmartClipResultHandler(final Handler resultHandler) { | 2297 public void setSmartClipResultHandler(final Handler resultHandler) { |
| 2294 checkThread(); | 2298 checkThread(); |
| 2295 mAwContents.setSmartClipResultHandler(resultHandler); | 2299 mAwContents.setSmartClipResultHandler(resultHandler); |
| 2296 } | 2300 } |
| 2297 } | 2301 } |
| OLD | NEW |