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