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.init; | 5 package org.chromium.chrome.browser.init; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 * will not trigger draws to the missing surface. However, we need to wait u
ntil | 489 * will not trigger draws to the missing surface. However, we need to wait u
ntil |
490 * after the first draw to make everything invisible, as the activity launch | 490 * after the first draw to make everything invisible, as the activity launch |
491 * animation needs a full frame (or it will delay the animation excessively)
. | 491 * animation needs a full frame (or it will delay the animation excessively)
. |
492 */ | 492 */ |
493 private final LaunchBehindWorkaround mLaunchBehindWorkaround = | 493 private final LaunchBehindWorkaround mLaunchBehindWorkaround = |
494 (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) | 494 (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP) |
495 ? new LaunchBehindWorkaround() | 495 ? new LaunchBehindWorkaround() |
496 : null; | 496 : null; |
497 | 497 |
498 private class LaunchBehindWorkaround { | 498 private class LaunchBehindWorkaround { |
499 private boolean mPaused = false; | 499 private boolean mPaused; |
500 | 500 |
501 private View getDecorView() { | 501 private View getDecorView() { |
502 return getWindow().getDecorView(); | 502 return getWindow().getDecorView(); |
503 } | 503 } |
504 | 504 |
505 private ViewTreeObserver getViewTreeObserver() { | 505 private ViewTreeObserver getViewTreeObserver() { |
506 return getDecorView().getViewTreeObserver(); | 506 return getDecorView().getViewTreeObserver(); |
507 } | 507 } |
508 | 508 |
509 private void onPause() { | 509 private void onPause() { |
(...skipping 22 matching lines...) Expand all Loading... |
532 getDecorView().setVisibility(View.GONE); | 532 getDecorView().setVisibility(View.GONE); |
533 } | 533 } |
534 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); | 534 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); |
535 } | 535 } |
536 }); | 536 }); |
537 return true; | 537 return true; |
538 } | 538 } |
539 }; | 539 }; |
540 } | 540 } |
541 } | 541 } |
OLD | NEW |