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.layouts.phone; | 5 package org.chromium.chrome.browser.compositor.layouts.phone; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.graphics.RectF; | 8 import android.graphics.RectF; |
9 import android.view.animation.Interpolator; | 9 import android.view.animation.Interpolator; |
10 | 10 |
11 import org.chromium.chrome.browser.compositor.LayerTitleCache; | 11 import org.chromium.chrome.browser.compositor.LayerTitleCache; |
12 import org.chromium.chrome.browser.compositor.layouts.ChromeAnimation.Animatable
; | 12 import org.chromium.chrome.browser.compositor.layouts.ChromeAnimation.Animatable
; |
13 import org.chromium.chrome.browser.compositor.layouts.Layout; | 13 import org.chromium.chrome.browser.compositor.layouts.Layout; |
14 import org.chromium.chrome.browser.compositor.layouts.LayoutRenderHost; | 14 import org.chromium.chrome.browser.compositor.layouts.LayoutRenderHost; |
15 import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost; | 15 import org.chromium.chrome.browser.compositor.layouts.LayoutUpdateHost; |
16 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; | 16 import org.chromium.chrome.browser.compositor.layouts.components.LayoutTab; |
17 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; | 17 import org.chromium.chrome.browser.compositor.layouts.content.TabContentManager; |
| 18 import org.chromium.chrome.browser.compositor.layouts.eventfilter.BlackHoleEvent
Filter; |
18 import org.chromium.chrome.browser.compositor.layouts.eventfilter.EventFilter; | 19 import org.chromium.chrome.browser.compositor.layouts.eventfilter.EventFilter; |
19 import org.chromium.chrome.browser.compositor.layouts.phone.stack.Stack; | 20 import org.chromium.chrome.browser.compositor.layouts.phone.stack.Stack; |
20 import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimation
; | 21 import org.chromium.chrome.browser.compositor.layouts.phone.stack.StackAnimation
; |
21 import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer; | 22 import org.chromium.chrome.browser.compositor.scene_layer.SceneLayer; |
22 import org.chromium.chrome.browser.compositor.scene_layer.TabListSceneLayer; | 23 import org.chromium.chrome.browser.compositor.scene_layer.TabListSceneLayer; |
23 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; | 24 import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; |
24 import org.chromium.chrome.browser.tab.Tab; | 25 import org.chromium.chrome.browser.tab.Tab; |
25 import org.chromium.chrome.browser.tabmodel.TabModel; | 26 import org.chromium.chrome.browser.tabmodel.TabModel; |
26 import org.chromium.ui.interpolators.BakedBezierInterpolator; | 27 import org.chromium.ui.interpolators.BakedBezierInterpolator; |
27 import org.chromium.ui.resources.ResourceManager; | 28 import org.chromium.ui.resources.ResourceManager; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 60 |
60 /** | 61 /** |
61 * A cached {@link LayoutTab} representation of the currently closing tab. I
f it's not | 62 * A cached {@link LayoutTab} representation of the currently closing tab. I
f it's not |
62 * null, it means tabClosing() has been called to start animation setup but | 63 * null, it means tabClosing() has been called to start animation setup but |
63 * tabClosed() has not yet been called to finish animation startup | 64 * tabClosed() has not yet been called to finish animation startup |
64 */ | 65 */ |
65 private LayoutTab mClosedTab; | 66 private LayoutTab mClosedTab; |
66 | 67 |
67 private LayoutTab mAnimatedTab; | 68 private LayoutTab mAnimatedTab; |
68 private final TabListSceneLayer mSceneLayer; | 69 private final TabListSceneLayer mSceneLayer; |
| 70 private final BlackHoleEventFilter mBlackHoleEventFilter; |
69 | 71 |
70 /** | 72 /** |
71 * Creates an instance of the {@link SimpleAnimationLayout}. | 73 * Creates an instance of the {@link SimpleAnimationLayout}. |
72 * @param context The current Android's context. | 74 * @param context The current Android's context. |
73 * @param updateHost The {@link LayoutUpdateHost} view for this layout. | 75 * @param updateHost The {@link LayoutUpdateHost} view for this layout. |
74 * @param renderHost The {@link LayoutRenderHost} view for this layout. | 76 * @param renderHost The {@link LayoutRenderHost} view for this layout. |
75 * @param eventFilter The {@link EventFilter} that is needed for this view. | 77 * @param eventFilter The {@link EventFilter} that is needed for this view. |
76 */ | 78 */ |
77 public SimpleAnimationLayout(Context context, LayoutUpdateHost updateHost, | 79 public SimpleAnimationLayout( |
78 LayoutRenderHost renderHost, EventFilter eventFilter) { | 80 Context context, LayoutUpdateHost updateHost, LayoutRenderHost rende
rHost) { |
79 super(context, updateHost, renderHost, eventFilter); | 81 super(context, updateHost, renderHost); |
| 82 mBlackHoleEventFilter = new BlackHoleEventFilter(context); |
80 mSceneLayer = new TabListSceneLayer(); | 83 mSceneLayer = new TabListSceneLayer(); |
81 } | 84 } |
82 | 85 |
83 @Override | 86 @Override |
84 public ViewportMode getViewportMode() { | 87 public ViewportMode getViewportMode() { |
85 return ViewportMode.USE_PREVIOUS_BROWSER_CONTROLS_STATE; | 88 return ViewportMode.USE_PREVIOUS_BROWSER_CONTROLS_STATE; |
86 } | 89 } |
87 | 90 |
88 @Override | 91 @Override |
89 public void show(long time, boolean animate) { | 92 public void show(long time, boolean animate) { |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 setDiscardAmount(value); | 403 setDiscardAmount(value); |
401 break; | 404 break; |
402 default: | 405 default: |
403 } | 406 } |
404 } | 407 } |
405 | 408 |
406 @Override | 409 @Override |
407 public void onPropertyAnimationFinished(Property prop) {} | 410 public void onPropertyAnimationFinished(Property prop) {} |
408 | 411 |
409 @Override | 412 @Override |
| 413 protected EventFilter getEventFilter() { |
| 414 return mBlackHoleEventFilter; |
| 415 } |
| 416 |
| 417 @Override |
410 protected SceneLayer getSceneLayer() { | 418 protected SceneLayer getSceneLayer() { |
411 return mSceneLayer; | 419 return mSceneLayer; |
412 } | 420 } |
413 | 421 |
414 @Override | 422 @Override |
415 protected void updateSceneLayer(RectF viewport, RectF contentViewport, | 423 protected void updateSceneLayer(RectF viewport, RectF contentViewport, |
416 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, | 424 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, |
417 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { | 425 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { |
418 super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabCo
ntentManager, | 426 super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabCo
ntentManager, |
419 resourceManager, fullscreenManager); | 427 resourceManager, fullscreenManager); |
420 assert mSceneLayer != null; | 428 assert mSceneLayer != null; |
421 // The content viewport is intentionally sent as both params below. | 429 // The content viewport is intentionally sent as both params below. |
422 mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, t
his, | 430 mSceneLayer.pushLayers(getContext(), contentViewport, contentViewport, t
his, |
423 layerTitleCache, tabContentManager, resourceManager, fullscreenM
anager); | 431 layerTitleCache, tabContentManager, resourceManager, fullscreenM
anager); |
424 } | 432 } |
425 } | 433 } |
OLD | NEW |