| 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.firstrun; | 5 package org.chromium.chrome.browser.firstrun; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.app.Fragment; | 8 import android.app.Fragment; |
| 9 import android.app.PendingIntent; | 9 import android.app.PendingIntent; |
| 10 import android.app.PendingIntent.CanceledException; | 10 import android.app.PendingIntent.CanceledException; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 mFreProgressStates.add(FRE_PROGRESS_SIGNIN_SHOWN); | 160 mFreProgressStates.add(FRE_PROGRESS_SIGNIN_SHOWN); |
| 161 notifyAdapter = true; | 161 notifyAdapter = true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 if (notifyAdapter && mPagerAdapter != null) { | 164 if (notifyAdapter && mPagerAdapter != null) { |
| 165 mPagerAdapter.notifyDataSetChanged(); | 165 mPagerAdapter.notifyDataSetChanged(); |
| 166 } | 166 } |
| 167 mPostNativePageSequenceCreated = true; | 167 mPostNativePageSequenceCreated = true; |
| 168 } | 168 } |
| 169 | 169 |
| 170 // AsyncInitializationActivity: | 170 @Override |
| 171 protected boolean requiresFirstRunToBeCompleted(Intent intent) { |
| 172 // The user is already in First Run. |
| 173 return false; |
| 174 } |
| 171 | 175 |
| 172 @Override | 176 @Override |
| 173 protected Bundle transformSavedInstanceStateForOnCreate(Bundle savedInstance
State) { | 177 protected Bundle transformSavedInstanceStateForOnCreate(Bundle savedInstance
State) { |
| 174 // We pass null to Activity.onCreate() so that it doesn't automatically
restore | 178 // We pass null to Activity.onCreate() so that it doesn't automatically
restore |
| 175 // the FragmentManager state - as that may cause fragments to be loaded
that have | 179 // the FragmentManager state - as that may cause fragments to be loaded
that have |
| 176 // dependencies on native before native has been loaded (and then crash)
. Instead, | 180 // dependencies on native before native has been loaded (and then crash)
. Instead, |
| 177 // these fragments will be recreated manually by us and their progressio
n restored | 181 // these fragments will be recreated manually by us and their progressio
n restored |
| 178 // from |mFreProperties| which we still get from getSavedInstanceState()
below. | 182 // from |mFreProperties| which we still get from getSavedInstanceState()
below. |
| 179 return null; | 183 return null; |
| 180 } | 184 } |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 Constructor<? extends FirstRunPage> constructor = clazz.getDecla
redConstructor(); | 595 Constructor<? extends FirstRunPage> constructor = clazz.getDecla
redConstructor(); |
| 592 return constructor.newInstance(); | 596 return constructor.newInstance(); |
| 593 } | 597 } |
| 594 }; | 598 }; |
| 595 } | 599 } |
| 596 | 600 |
| 597 @Override | 601 @Override |
| 598 public void showInfoPage(int url) { | 602 public void showInfoPage(int url) { |
| 599 CustomTabActivity.showInfoPage(this, getString(url)); | 603 CustomTabActivity.showInfoPage(this, getString(url)); |
| 600 } | 604 } |
| 605 |
| 606 /** Returns whether or not First Run is ready for interaction. */ |
| 607 @VisibleForTesting |
| 608 public boolean isPostNativePageSequenceCreated() { |
| 609 return mPostNativePageSequenceCreated; |
| 610 } |
| 601 } | 611 } |
| OLD | NEW |