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 static org.chromium.chrome.browser.compositor.layouts.ChromeAnimation.Ani
matableAnimation.createAnimation; | 7 import static org.chromium.chrome.browser.compositor.layouts.ChromeAnimation.Ani
matableAnimation.createAnimation; |
8 | 8 |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.graphics.Point; | 10 import android.graphics.Point; |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 * | 355 * |
356 * @param context The current Android's context. | 356 * @param context The current Android's context. |
357 */ | 357 */ |
358 public void contextChanged(Context context) { | 358 public void contextChanged(Context context) { |
359 mContext = context; | 359 mContext = context; |
360 LayoutTab.resetDimensionConstants(context); | 360 LayoutTab.resetDimensionConstants(context); |
361 } | 361 } |
362 | 362 |
363 /** | 363 /** |
364 * Called when the size of the viewport has changed. | 364 * Called when the size of the viewport has changed. |
365 * @param availableViewport The actual viewport this {@link Layout} sho
uld be rendering to. | |
366 * @param visibleViewport The visible viewport that represents the ar
ea on the screen | 365 * @param visibleViewport The visible viewport that represents the ar
ea on the screen |
367 * this {@link Layout} gets to draw to (potent
ially takes into | 366 * this {@link Layout} gets to draw to (potent
ially takes into |
368 * account top controls). | 367 * account top controls). |
369 * @param screenViewport The viewport of the screen. | 368 * @param screenViewport The viewport of the screen. |
370 * @param heightMinusTopControls The height the {@link Layout} gets excludin
g the height of the | 369 * @param heightMinusTopControls The height the {@link Layout} gets excludin
g the height of the |
371 * top controls. TODO(dtrainor): Look at gett
ing rid of this. | 370 * top controls. TODO(dtrainor): Look at gett
ing rid of this. |
372 * @param orientation The new orientation. Valid values are defi
ned by | 371 * @param orientation The new orientation. Valid values are defi
ned by |
373 * {@link Orientation}. | 372 * {@link Orientation}. |
374 */ | 373 */ |
375 public final void sizeChanged(RectF availableViewport, RectF visibleViewport
, | 374 public final void sizeChanged(RectF visibleViewport, RectF screenViewport, |
376 RectF screenViewport, float heightMinusTopControls, int orientation)
{ | 375 float heightMinusTopControls, int orientation) { |
377 // 1. Pull out this Layout's specific width and height properties based
on the available | 376 // 1. Pull out this Layout's width and height properties based on the vi
ewport. |
378 // viewport. | 377 float width = screenViewport.width(); |
379 float width = availableViewport.width(); | 378 float height = screenViewport.height(); |
380 float height = availableViewport.height(); | |
381 | 379 |
382 // 2. Check if any Layout-specific properties have changed. | 380 // 2. Check if any Layout-specific properties have changed. |
383 boolean layoutPropertiesChanged = mWidth != width | 381 boolean layoutPropertiesChanged = mWidth != width |
384 || mHeight != height | 382 || mHeight != height |
385 || mHeightMinusTopControls != heightMinusTopControls | 383 || mHeightMinusTopControls != heightMinusTopControls |
386 || mCurrentOrientation != orientation; | 384 || mCurrentOrientation != orientation; |
387 | 385 |
388 // 3. Update the internal sizing properties. | 386 // 3. Update the internal sizing properties. |
389 mWidth = width; | 387 mWidth = width; |
390 mHeight = height; | 388 mHeight = height; |
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 | 1213 |
1216 /** | 1214 /** |
1217 * Update {@link SceneLayer} instance this layout holds. Any class inheritin
g {@link Layout} | 1215 * Update {@link SceneLayer} instance this layout holds. Any class inheritin
g {@link Layout} |
1218 * should override this function in order for other functions to work. | 1216 * should override this function in order for other functions to work. |
1219 */ | 1217 */ |
1220 protected void updateSceneLayer(Rect viewport, Rect contentViewport, | 1218 protected void updateSceneLayer(Rect viewport, Rect contentViewport, |
1221 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, | 1219 LayerTitleCache layerTitleCache, TabContentManager tabContentManager
, |
1222 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { | 1220 ResourceManager resourceManager, ChromeFullscreenManager fullscreenM
anager) { |
1223 } | 1221 } |
1224 } | 1222 } |
OLD | NEW |