| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.res.Configuration; | 9 import android.content.res.Configuration; |
| 10 import android.graphics.Bitmap; | 10 import android.graphics.Bitmap; |
| 11 import android.graphics.Canvas; | 11 import android.graphics.Canvas; |
| 12 import android.graphics.Rect; | 12 import android.graphics.Rect; |
| 13 import android.os.Build; | 13 import android.os.Build; |
| 14 import android.util.AttributeSet; | 14 import android.util.AttributeSet; |
| 15 import android.view.KeyEvent; | 15 import android.view.KeyEvent; |
| 16 import android.view.MotionEvent; | 16 import android.view.MotionEvent; |
| 17 import android.view.View; | 17 import android.view.View; |
| 18 import android.view.accessibility.AccessibilityEvent; | 18 import android.view.accessibility.AccessibilityEvent; |
| 19 import android.view.accessibility.AccessibilityNodeInfo; | 19 import android.view.accessibility.AccessibilityNodeInfo; |
| 20 import android.view.inputmethod.EditorInfo; | 20 import android.view.inputmethod.EditorInfo; |
| 21 import android.view.inputmethod.InputConnection; | 21 import android.view.inputmethod.InputConnection; |
| 22 import android.widget.FrameLayout; | 22 import android.widget.FrameLayout; |
| 23 | 23 |
| 24 import com.google.common.annotations.VisibleForTesting; | 24 import com.google.common.annotations.VisibleForTesting; |
| 25 | 25 |
| 26 import org.chromium.content.common.ProcessInitException; | |
| 27 import org.chromium.content.common.TraceEvent; | 26 import org.chromium.content.common.TraceEvent; |
| 28 import org.chromium.ui.gfx.NativeWindow; | 27 import org.chromium.ui.gfx.NativeWindow; |
| 29 | 28 |
| 30 import java.util.ArrayList; | |
| 31 | |
| 32 /** | 29 /** |
| 33 * The containing view for {@link ContentViewCore} that exists in the Android UI
hierarchy and | 30 * The containing view for {@link ContentViewCore} that exists in the Android UI
hierarchy and |
| 34 * exposes the various {@link View} functionality to it. | 31 * exposes the various {@link View} functionality to it. |
| 35 * | 32 * |
| 36 * TODO(joth): Remove any methods overrides from this class that were added for
WebView | 33 * TODO(joth): Remove any methods overrides from this class that were added for
WebView |
| 37 * compatibility. | 34 * compatibility. |
| 38 */ | 35 */ |
| 39 public class ContentView extends FrameLayout implements ContentViewCore.Internal
AccessDelegate { | 36 public class ContentView extends FrameLayout implements ContentViewCore.Internal
AccessDelegate { |
| 40 // Used when ContentView implements a standalone View. | 37 // Used when ContentView implements a standalone View. |
| 41 public static final int PERSONALITY_VIEW = ContentViewCore.PERSONALITY_VIEW; | 38 public static final int PERSONALITY_VIEW = ContentViewCore.PERSONALITY_VIEW; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 226 |
| 230 public Bitmap getBitmap() { | 227 public Bitmap getBitmap() { |
| 231 return getBitmap(getWidth(), getHeight()); | 228 return getBitmap(getWidth(), getHeight()); |
| 232 } | 229 } |
| 233 | 230 |
| 234 public Bitmap getBitmap(int width, int height) { | 231 public Bitmap getBitmap(int width, int height) { |
| 235 return mContentViewCore.getBitmap(width, height); | 232 return mContentViewCore.getBitmap(width, height); |
| 236 } | 233 } |
| 237 | 234 |
| 238 /** | 235 /** |
| 239 * @return Whether the ContentView is covered by an overlay that is more tha
n half | |
| 240 * of it's surface. This is used to determine if we need to do a slo
w bitmap capture or | |
| 241 * to show the ContentView without them. | |
| 242 */ | |
| 243 public boolean hasLargeOverlay() { | |
| 244 return mContentViewCore.hasLargeOverlay(); | |
| 245 } | |
| 246 | |
| 247 /** | |
| 248 * @return Whether the current WebContents has a previous navigation entry. | 236 * @return Whether the current WebContents has a previous navigation entry. |
| 249 */ | 237 */ |
| 250 public boolean canGoBack() { | 238 public boolean canGoBack() { |
| 251 return mContentViewCore.canGoBack(); | 239 return mContentViewCore.canGoBack(); |
| 252 } | 240 } |
| 253 | 241 |
| 254 /** | 242 /** |
| 255 * @return Whether the current WebContents has a navigation entry after the
current one. | 243 * @return Whether the current WebContents has a navigation entry after the
current one. |
| 256 */ | 244 */ |
| 257 public boolean canGoForward() { | 245 public boolean canGoForward() { |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 * If the view is ready to draw contents to the screen. In hardware mode, | 757 * If the view is ready to draw contents to the screen. In hardware mode, |
| 770 * the initialization of the surface texture may not occur until after the | 758 * the initialization of the surface texture may not occur until after the |
| 771 * view has been added to the layout. This method will return {@code true} | 759 * view has been added to the layout. This method will return {@code true} |
| 772 * once the texture is actually ready. | 760 * once the texture is actually ready. |
| 773 */ | 761 */ |
| 774 public boolean isReady() { | 762 public boolean isReady() { |
| 775 return mContentViewCore.isReady(); | 763 return mContentViewCore.isReady(); |
| 776 } | 764 } |
| 777 | 765 |
| 778 /** | 766 /** |
| 779 * @return Whether or not the texture view is available or not. | |
| 780 */ | |
| 781 public boolean isAvailable() { | |
| 782 return mContentViewCore.isAvailable(); | |
| 783 } | |
| 784 | |
| 785 /** | |
| 786 * Returns whether or not accessibility injection is being used. | 767 * Returns whether or not accessibility injection is being used. |
| 787 */ | 768 */ |
| 788 public boolean isInjectingAccessibilityScript() { | 769 public boolean isInjectingAccessibilityScript() { |
| 789 return mContentViewCore.isInjectingAccessibilityScript(); | 770 return mContentViewCore.isInjectingAccessibilityScript(); |
| 790 } | 771 } |
| 791 | 772 |
| 792 /** | 773 /** |
| 793 * Enable or disable accessibility features. | 774 * Enable or disable accessibility features. |
| 794 */ | 775 */ |
| 795 public void setAccessibilityState(boolean state) { | 776 public void setAccessibilityState(boolean state) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 | 822 |
| 842 @Override | 823 @Override |
| 843 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { | 824 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { |
| 844 return super.awakenScrollBars(startDelay, invalidate); | 825 return super.awakenScrollBars(startDelay, invalidate); |
| 845 } | 826 } |
| 846 | 827 |
| 847 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 828 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 848 // End Implementation of ContentViewCore.InternalAccessDelega
te // | 829 // End Implementation of ContentViewCore.InternalAccessDelega
te // |
| 849 ////////////////////////////////////////////////////////////////////////////
/////////////////// | 830 ////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 850 } | 831 } |
| OLD | NEW |