| 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.document; | 5 package org.chromium.chrome.browser.document; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; | 7 import android.annotation.TargetApi; |
| 8 import android.content.Intent; | 8 import android.content.Intent; |
| 9 import android.graphics.Color; | 9 import android.graphics.Color; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) { | 269 if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) { |
| 270 DataReductionPromoScreen.launchDataReductionPromo(this); | 270 DataReductionPromoScreen.launchDataReductionPromo(this); |
| 271 } | 271 } |
| 272 } else { | 272 } else { |
| 273 preferenceManager.setPromosSkippedOnFirstStart(true); | 273 preferenceManager.setPromosSkippedOnFirstStart(true); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 FirstRunSignInProcessor.start(this); | 277 FirstRunSignInProcessor.start(this); |
| 278 | 278 |
| 279 if (!preferenceManager.hasAttemptedMigrationOnUpgrade()) { | |
| 280 InitializationObserver observer = new InitializationObserver( | |
| 281 ChromeApplication.getDocumentTabModelSelector().getModel(fal
se)) { | |
| 282 @Override | |
| 283 protected void runImmediately() { | |
| 284 DocumentMigrationHelper.migrateTabsToDocumentForUpgrade(Docu
mentActivity.this, | |
| 285 DocumentMigrationHelper.FINALIZE_MODE_NO_ACTION); | |
| 286 } | |
| 287 | |
| 288 @Override | |
| 289 public boolean isSatisfied(int currentState) { | |
| 290 return currentState == DocumentTabModelImpl.STATE_FULLY_LOAD
ED; | |
| 291 } | |
| 292 | |
| 293 @Override | |
| 294 public boolean isCanceled() { | |
| 295 return false; | |
| 296 } | |
| 297 }; | |
| 298 | |
| 299 observer.runWhenReady(); | |
| 300 } | |
| 301 | |
| 302 getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS, | 279 getWindow().setFeatureInt(Window.FEATURE_INDETERMINATE_PROGRESS, |
| 303 Window.PROGRESS_VISIBILITY_OFF); | 280 Window.PROGRESS_VISIBILITY_OFF); |
| 304 | 281 |
| 305 // Initialize the native-side TabModels so that the Profile is available
when necessary. | 282 // Initialize the native-side TabModels so that the Profile is available
when necessary. |
| 306 ChromeApplication.getDocumentTabModelSelector().onNativeLibraryReady(); | 283 ChromeApplication.getDocumentTabModelSelector().onNativeLibraryReady(); |
| 307 mTabInitializationObserver.runWhenReady(); | 284 mTabInitializationObserver.runWhenReady(); |
| 308 | 285 |
| 309 if (mNeedsToBeAddedToTabModel) { | 286 if (mNeedsToBeAddedToTabModel) { |
| 310 mNeedsToBeAddedToTabModel = false; | 287 mNeedsToBeAddedToTabModel = false; |
| 311 mTabModel.addTab(getIntent(), mTab); | 288 mTabModel.addTab(getIntent(), mTab); |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 | 854 |
| 878 /** | 855 /** |
| 879 * Launch a new DocumentActivity showing the new tab page. | 856 * Launch a new DocumentActivity showing the new tab page. |
| 880 * @param incognito Whether the new NTP should be in incognito mode. | 857 * @param incognito Whether the new NTP should be in incognito mode. |
| 881 */ | 858 */ |
| 882 private void launchNtp(boolean incognito) { | 859 private void launchNtp(boolean incognito) { |
| 883 if (incognito && !PrefServiceBridge.getInstance().isIncognitoModeEnabled
()) return; | 860 if (incognito && !PrefServiceBridge.getInstance().isIncognitoModeEnabled
()) return; |
| 884 getTabCreator(incognito).launchNTP(); | 861 getTabCreator(incognito).launchNTP(); |
| 885 } | 862 } |
| 886 } | 863 } |
| OLD | NEW |