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; | 5 package org.chromium.chrome.browser.compositor.layouts; |
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.os.Handler; | 9 import android.os.Handler; |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 private final UnstallRunnable mUnstallRunnable; | 54 private final UnstallRunnable mUnstallRunnable; |
55 private final Handler mHandler; | 55 private final Handler mHandler; |
56 private boolean mUnstalling; | 56 private boolean mUnstalling; |
57 private StaticTabSceneLayer mSceneLayer; | 57 private StaticTabSceneLayer mSceneLayer; |
58 | 58 |
59 /** | 59 /** |
60 * Creates an instance of the {@link StaticLayout}. | 60 * Creates an instance of the {@link StaticLayout}. |
61 * @param context The current Android's context. | 61 * @param context The current Android's context. |
62 * @param updateHost The {@link LayoutUpdateHost} view for this lay
out. | 62 * @param updateHost The {@link LayoutUpdateHost} view for this lay
out. |
63 * @param renderHost The {@link LayoutRenderHost} view for this lay
out. | 63 * @param renderHost The {@link LayoutRenderHost} view for this lay
out. |
| 64 * @param eventFilter The {@link EventFilter} that is needed for thi
s view. |
64 * @param panelManager The {@link OverlayPanelManager} responsible fo
r showing panels. | 65 * @param panelManager The {@link OverlayPanelManager} responsible fo
r showing panels. |
65 */ | 66 */ |
66 public StaticLayout(Context context, LayoutUpdateHost updateHost, LayoutRend
erHost renderHost, | 67 public StaticLayout(Context context, LayoutUpdateHost updateHost, LayoutRend
erHost renderHost, |
67 EventFilter eventFilter, OverlayPanelManager panelManager) { | 68 EventFilter eventFilter, OverlayPanelManager panelManager) { |
68 super(context, updateHost, renderHost); | 69 super(context, updateHost, renderHost, eventFilter); |
69 | 70 |
70 mHandler = new Handler(); | 71 mHandler = new Handler(); |
71 mUnstallRunnable = new UnstallRunnable(); | 72 mUnstallRunnable = new UnstallRunnable(); |
72 mUnstalling = false; | 73 mUnstalling = false; |
73 mSceneLayer = new StaticTabSceneLayer(R.id.control_container); | 74 mSceneLayer = new StaticTabSceneLayer(R.id.control_container); |
74 } | 75 } |
75 | 76 |
76 /** | 77 /** |
77 * @param handlesTabLifecycles Whether or not this {@link Layout} should han
dle tab closing and | 78 * @param handlesTabLifecycles Whether or not this {@link Layout} should han
dle tab closing and |
78 * creating events. | 79 * creating events. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 public boolean shouldDisplayContentOverlay() { | 207 public boolean shouldDisplayContentOverlay() { |
207 return true; | 208 return true; |
208 } | 209 } |
209 | 210 |
210 @Override | 211 @Override |
211 public boolean isTabInteractive() { | 212 public boolean isTabInteractive() { |
212 return mLayoutTabs != null && mLayoutTabs.length > 0; | 213 return mLayoutTabs != null && mLayoutTabs.length > 0; |
213 } | 214 } |
214 | 215 |
215 @Override | 216 @Override |
216 protected EventFilter getEventFilter() { | |
217 return null; | |
218 } | |
219 | |
220 @Override | |
221 protected SceneLayer getSceneLayer() { | 217 protected SceneLayer getSceneLayer() { |
222 return mSceneLayer; | 218 return mSceneLayer; |
223 } | 219 } |
224 | 220 |
225 @Override | 221 @Override |
226 protected void updateSceneLayer(RectF viewport, RectF contentViewport, | 222 protected void updateSceneLayer(RectF viewport, RectF contentViewport, |
227 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, | 223 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, |
228 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { | 224 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { |
229 super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabCo
ntentManager, | 225 super.updateSceneLayer(viewport, contentViewport, layerTitleCache, tabCo
ntentManager, |
230 resourceManager, fullscreenManager); | 226 resourceManager, fullscreenManager); |
(...skipping 18 matching lines...) Expand all Loading... |
249 } | 245 } |
250 | 246 |
251 @Override | 247 @Override |
252 public void destroy() { | 248 public void destroy() { |
253 if (mSceneLayer != null) { | 249 if (mSceneLayer != null) { |
254 mSceneLayer.destroy(); | 250 mSceneLayer.destroy(); |
255 mSceneLayer = null; | 251 mSceneLayer = null; |
256 } | 252 } |
257 } | 253 } |
258 } | 254 } |
OLD | NEW |