| 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; | 5 package org.chromium.chrome.browser; |
| 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.app.SearchManager; | 10 import android.app.SearchManager; |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 createContextReporterIfNeeded(); | 571 createContextReporterIfNeeded(); |
| 572 } else { | 572 } else { |
| 573 ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABL
E); | 573 ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABL
E); |
| 574 } | 574 } |
| 575 mCompositorViewHolder.resetFlags(); | 575 mCompositorViewHolder.resetFlags(); |
| 576 | 576 |
| 577 // postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever
#onLoadStopped(), | 577 // postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever
#onLoadStopped(), |
| 578 // #onPageLoadFinished() and #onCrash(). If we are not actively loading
a tab (e.g. | 578 // #onPageLoadFinished() and #onCrash(). If we are not actively loading
a tab (e.g. |
| 579 // in Android N multi-instance, which is created by re-parenting an exis
ting tab), | 579 // in Android N multi-instance, which is created by re-parenting an exis
ting tab), |
| 580 // ensure onDeferredStartup() gets called by calling postDeferredStartup
IfNeeded() here. | 580 // ensure onDeferredStartup() gets called by calling postDeferredStartup
IfNeeded() here. |
| 581 if (!getActivityTab().isLoading()) { | 581 if (getActivityTab() == null || !getActivityTab().isLoading()) { |
| 582 postDeferredStartupIfNeeded(); | 582 postDeferredStartupIfNeeded(); |
| 583 } | 583 } |
| 584 } | 584 } |
| 585 | 585 |
| 586 @Override | 586 @Override |
| 587 public void onWindowFocusChanged(boolean hasFocus) { | 587 public void onWindowFocusChanged(boolean hasFocus) { |
| 588 super.onWindowFocusChanged(hasFocus); | 588 super.onWindowFocusChanged(hasFocus); |
| 589 Tab tab = getActivityTab(); | 589 Tab tab = getActivityTab(); |
| 590 if (tab == null) return; | 590 if (tab == null) return; |
| 591 if (hasFocus) { | 591 if (hasFocus) { |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", | 1741 "Android.MultiWindowMode.IsTabletScreenWidthBelow600", |
| 1742 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); | 1742 mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP); |
| 1743 | 1743 |
| 1744 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { | 1744 if (mScreenWidthDp < DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP) { |
| 1745 RecordHistogram.recordLinearCountHistogram( | 1745 RecordHistogram.recordLinearCountHistogram( |
| 1746 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, | 1746 "Android.MultiWindowMode.TabletScreenWidth", mScreenWidthDp,
1, |
| 1747 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); | 1747 DeviceFormFactor.MINIMUM_TABLET_WIDTH_DP, 50); |
| 1748 } | 1748 } |
| 1749 } | 1749 } |
| 1750 } | 1750 } |
| OLD | NEW |