| 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.graphics.Point; | 7 import android.graphics.Point; |
| 8 import android.graphics.Rect; | 8 import android.graphics.Rect; |
| 9 import android.graphics.RectF; | 9 import android.graphics.RectF; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 tabContentManager, resourceManager, fullscreenManager); | 280 tabContentManager, resourceManager, fullscreenManager); |
| 281 } | 281 } |
| 282 | 282 |
| 283 /** | 283 /** |
| 284 * Called when the viewport has been changed. Override this to be notified
when | 284 * Called when the viewport has been changed. Override this to be notified
when |
| 285 * {@link #pushNewViewport(Rect, Rect, int)} calls actually change the curre
nt viewport. | 285 * {@link #pushNewViewport(Rect, Rect, int)} calls actually change the curre
nt viewport. |
| 286 * @param viewportDp The new viewport in dp. | 286 * @param viewportDp The new viewport in dp. |
| 287 */ | 287 */ |
| 288 protected void onViewportChanged(RectF viewportDp) { | 288 protected void onViewportChanged(RectF viewportDp) { |
| 289 if (getActiveLayout() != null) { | 289 if (getActiveLayout() != null) { |
| 290 getActiveLayout().sizeChanged(viewportDp, mLastVisibleViewportDp, | 290 getActiveLayout().sizeChanged(mLastVisibleViewportDp, mLastFullscree
nViewportDp, |
| 291 mLastFullscreenViewportDp, mLastHeightMinusTopControlsDp, ge
tOrientation()); | 291 mLastHeightMinusTopControlsDp, getOrientation()); |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 /** | 295 /** |
| 296 * Should be called from an external source when the viewport changes. {@co
de viewport} and | 296 * Should be called from an external source when the viewport changes. {@co
de viewport} and |
| 297 * {@code visibleViewport} are different, as the top controls might be cover
ing part of the | 297 * {@code visibleViewport} are different, as the top controls might be cover
ing part of the |
| 298 * viewport but a {@link Layout} might want to consume the whole space (or n
ot). | 298 * viewport but a {@link Layout} might want to consume the whole space (or n
ot). |
| 299 * @param viewport The new viewport in px. | 299 * @param viewport The new viewport in px. |
| 300 * @param visibleViewport The new visible viewport in px. | 300 * @param visibleViewport The new visible viewport in px. |
| 301 * @param heightMinusTopControls The height of the viewport minus the top co
ntrols. | 301 * @param heightMinusTopControls The height of the viewport minus the top co
ntrols. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 @Override | 549 @Override |
| 550 public void run() { | 550 public void run() { |
| 551 mTabModelSelector.removeObserver(observer); | 551 mTabModelSelector.removeObserver(observer); |
| 552 } | 552 } |
| 553 }); | 553 }); |
| 554 } | 554 } |
| 555 }); | 555 }); |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 } | 558 } |
| OLD | NEW |