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.ActivityManager; | 10 import android.app.ActivityManager; |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 @Override | 395 @Override |
396 public void finishNativeInitialization() { | 396 public void finishNativeInitialization() { |
397 try { | 397 try { |
398 TraceEvent.begin("ChromeTabbedActivity.finishNativeInitialization"); | 398 TraceEvent.begin("ChromeTabbedActivity.finishNativeInitialization"); |
399 | 399 |
400 refreshSignIn(); | 400 refreshSignIn(); |
401 | 401 |
402 ChromePreferenceManager preferenceManager = ChromePreferenceManager.
getInstance(); | 402 ChromePreferenceManager preferenceManager = ChromePreferenceManager.
getInstance(); |
403 // Promos can only be shown when we start with ACTION_MAIN intent an
d | 403 // Promos can only be shown when we start with ACTION_MAIN intent an
d |
404 // after FRE is complete. | 404 // after FRE is complete. Native initialization can finish before th
e FRE flow is |
405 if (!mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete())
{ | 405 // complete, and this will only show promos on the second opportunit
y. This is because |
406 // Only show promos on the second oppurtunity. This is because w
e show FRE on the | 406 // the FRE is shown on the first opportunity, and we don't want to s
how such content |
407 // first oppurtunity, and we don't want to show such content bac
k to back. | 407 // back to back. |
408 if (preferenceManager.getPromosSkippedOnFirstStart()) { | 408 if (!mIntentWithEffect && FirstRunStatus.getFirstRunFlowComplete() |
409 // Data reduction promo should be temporarily suppressed if
the sign in promo is | 409 && preferenceManager.getPromosSkippedOnFirstStart()) { |
410 // shown to avoid nagging users too much. | 410 // Data reduction promo should be temporarily suppressed if the
sign in promo is |
411 if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) { | 411 // shown to avoid nagging users too much. |
412 DataReductionPromoScreen.launchDataReductionPromo(this); | 412 if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) { |
413 } | 413 DataReductionPromoScreen.launchDataReductionPromo(this); |
414 } else { | |
415 preferenceManager.setPromosSkippedOnFirstStart(true); | |
416 } | 414 } |
| 415 } else { |
| 416 preferenceManager.setPromosSkippedOnFirstStart(true); |
417 } | 417 } |
418 | 418 |
419 initializeUI(); | 419 initializeUI(); |
420 | 420 |
421 // The dataset has already been created, we need to initialize our s
tate. | 421 // The dataset has already been created, we need to initialize our s
tate. |
422 mTabModelSelectorImpl.notifyChanged(); | 422 mTabModelSelectorImpl.notifyChanged(); |
423 | 423 |
424 ApiCompatibilityUtils.setWindowIndeterminateProgress(getWindow()); | 424 ApiCompatibilityUtils.setWindowIndeterminateProgress(getWindow()); |
425 | 425 |
426 // Check for incognito tabs to handle the case where Chrome was swip
ed away in the | 426 // Check for incognito tabs to handle the case where Chrome was swip
ed away in the |
(...skipping 1561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1988 | 1988 |
1989 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT
IVITY_SERVICE); | 1989 ActivityManager manager = (ActivityManager) getSystemService(Context.ACT
IVITY_SERVICE); |
1990 for (AppTask task : manager.getAppTasks()) { | 1990 for (AppTask task : manager.getAppTasks()) { |
1991 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); | 1991 RecentTaskInfo info = DocumentUtils.getTaskInfoFromTask(task); |
1992 if (info == null) continue; | 1992 if (info == null) continue; |
1993 if (info.id == sMergedInstanceTaskId) return true; | 1993 if (info.id == sMergedInstanceTaskId) return true; |
1994 } | 1994 } |
1995 return false; | 1995 return false; |
1996 } | 1996 } |
1997 } | 1997 } |
OLD | NEW |