| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.compositor; | 5 package org.chromium.chrome.browser.compositor; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.Canvas; | 8 import android.graphics.Canvas; |
| 9 import android.graphics.Color; | 9 import android.graphics.Color; |
| 10 import android.graphics.Paint; | 10 import android.graphics.Paint; |
| 11 import android.graphics.Rect; | 11 import android.graphics.Rect; |
| 12 import android.graphics.RectF; | 12 import android.graphics.RectF; |
| 13 import android.os.Bundle; | 13 import android.os.Bundle; |
| 14 import android.os.Handler; | 14 import android.os.Handler; |
| 15 import android.support.v4.view.ViewCompat; | 15 import android.support.v4.view.ViewCompat; |
| 16 import android.support.v4.view.accessibility.AccessibilityEventCompat; | 16 import android.support.v4.view.accessibility.AccessibilityEventCompat; |
| 17 import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; | 17 import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; |
| 18 import android.support.v4.widget.ExploreByTouchHelper; | 18 import android.support.v4.widget.ExploreByTouchHelper; |
| 19 import android.util.AttributeSet; | 19 import android.util.AttributeSet; |
| 20 import android.util.Pair; | 20 import android.util.Pair; |
| 21 import android.view.DragEvent; | 21 import android.view.DragEvent; |
| 22 import android.view.MotionEvent; | 22 import android.view.MotionEvent; |
| 23 import android.view.SurfaceView; | |
| 24 import android.view.View; | 23 import android.view.View; |
| 25 import android.view.ViewGroup; | 24 import android.view.ViewGroup; |
| 26 import android.view.accessibility.AccessibilityEvent; | 25 import android.view.accessibility.AccessibilityEvent; |
| 27 import android.widget.FrameLayout; | 26 import android.widget.FrameLayout; |
| 28 | 27 |
| 29 import org.chromium.base.SysUtils; | 28 import org.chromium.base.SysUtils; |
| 30 import org.chromium.base.TraceEvent; | 29 import org.chromium.base.TraceEvent; |
| 31 import org.chromium.base.annotations.SuppressFBWarnings; | 30 import org.chromium.base.annotations.SuppressFBWarnings; |
| 32 import org.chromium.chrome.R; | 31 import org.chromium.chrome.R; |
| 33 import org.chromium.chrome.browser.compositor.Invalidator.Client; | 32 import org.chromium.chrome.browser.compositor.Invalidator.Client; |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 397 } |
| 399 | 398 |
| 400 /** | 399 /** |
| 401 * @return The {@link LayoutManager} associated with this view. | 400 * @return The {@link LayoutManager} associated with this view. |
| 402 */ | 401 */ |
| 403 public LayoutManager getLayoutManager() { | 402 public LayoutManager getLayoutManager() { |
| 404 return mLayoutManager; | 403 return mLayoutManager; |
| 405 } | 404 } |
| 406 | 405 |
| 407 /** | 406 /** |
| 408 * @return The SurfaceView used by the Compositor. | 407 * @return The SurfaceView proxy used by the Compositor. |
| 409 */ | 408 */ |
| 410 public SurfaceView getSurfaceView() { | 409 public View getCompositorView() { |
| 411 return mCompositorView; | 410 return mCompositorView; |
| 412 } | 411 } |
| 413 | 412 |
| 414 private View getActiveView() { | 413 private View getActiveView() { |
| 415 if (mLayoutManager == null || mTabModelSelector == null) return null; | 414 if (mLayoutManager == null || mTabModelSelector == null) return null; |
| 416 Tab tab = mTabModelSelector.getCurrentTab(); | 415 Tab tab = mTabModelSelector.getCurrentTab(); |
| 417 return tab != null ? tab.getContentView() : null; | 416 return tab != null ? tab.getContentView() : null; |
| 418 } | 417 } |
| 419 | 418 |
| 420 private ContentViewCore getActiveContent() { | 419 private ContentViewCore getActiveContent() { |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 if (mPixelRect.width() == 0) { | 1094 if (mPixelRect.width() == 0) { |
| 1096 mPixelRect.right = mPixelRect.left + 1; | 1095 mPixelRect.right = mPixelRect.left + 1; |
| 1097 } | 1096 } |
| 1098 if (mPixelRect.height() == 0) { | 1097 if (mPixelRect.height() == 0) { |
| 1099 mPixelRect.bottom = mPixelRect.top + 1; | 1098 mPixelRect.bottom = mPixelRect.top + 1; |
| 1100 } | 1099 } |
| 1101 return mPixelRect; | 1100 return mPixelRect; |
| 1102 } | 1101 } |
| 1103 } | 1102 } |
| 1104 } | 1103 } |
| OLD | NEW |