Chromium Code Reviews| 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 20 matching lines...) Expand all Loading... | |
| 31 import org.chromium.base.VisibleForTesting; | 31 import org.chromium.base.VisibleForTesting; |
| 32 import org.chromium.base.library_loader.LibraryLoader; | 32 import org.chromium.base.library_loader.LibraryLoader; |
| 33 import org.chromium.base.library_loader.LoaderErrors; | 33 import org.chromium.base.library_loader.LoaderErrors; |
| 34 import org.chromium.base.library_loader.ProcessInitException; | 34 import org.chromium.base.library_loader.ProcessInitException; |
| 35 import org.chromium.chrome.R; | 35 import org.chromium.chrome.R; |
| 36 import org.chromium.chrome.browser.ChromeApplication; | 36 import org.chromium.chrome.browser.ChromeApplication; |
| 37 import org.chromium.chrome.browser.WarmupManager; | 37 import org.chromium.chrome.browser.WarmupManager; |
| 38 import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; | 38 import org.chromium.chrome.browser.firstrun.FirstRunFlowSequencer; |
| 39 import org.chromium.chrome.browser.metrics.MemoryUma; | 39 import org.chromium.chrome.browser.metrics.MemoryUma; |
| 40 import org.chromium.chrome.browser.profiles.Profile; | 40 import org.chromium.chrome.browser.profiles.Profile; |
| 41 import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider; | |
| 41 import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin; | 42 import org.chromium.chrome.browser.tabmodel.DocumentModeAssassin; |
| 42 import org.chromium.chrome.browser.upgrade.UpgradeActivity; | 43 import org.chromium.chrome.browser.upgrade.UpgradeActivity; |
| 43 import org.chromium.ui.base.ActivityWindowAndroid; | 44 import org.chromium.ui.base.ActivityWindowAndroid; |
| 44 import org.chromium.ui.base.DeviceFormFactor; | 45 import org.chromium.ui.base.DeviceFormFactor; |
| 45 import org.chromium.ui.base.WindowAndroid; | 46 import org.chromium.ui.base.WindowAndroid; |
| 46 | 47 |
| 47 import java.lang.reflect.Field; | 48 import java.lang.reflect.Field; |
| 48 | 49 |
| 49 /** | 50 /** |
| 50 * An activity that talks with application and activity level delegates for asyn c initialization. | 51 * An activity that talks with application and activity level delegates for asyn c initialization. |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 }); | 206 }); |
| 206 mMemoryUma = new MemoryUma(); | 207 mMemoryUma = new MemoryUma(); |
| 207 mNativeInitializationController.onNativeInitializationComplete(); | 208 mNativeInitializationController.onNativeInitializationComplete(); |
| 208 } | 209 } |
| 209 | 210 |
| 210 /** | 211 /** |
| 211 * Actions that may be run at some point after startup. Place tasks that are not critical to the | 212 * Actions that may be run at some point after startup. Place tasks that are not critical to the |
| 212 * startup path here. This method will be called automatically and should n ot be called | 213 * startup path here. This method will be called automatically and should n ot be called |
| 213 * directly by subclasses. | 214 * directly by subclasses. |
| 214 */ | 215 */ |
| 215 protected void onDeferredStartup() { } | 216 protected void onDeferredStartup() { |
| 217 mHandler.post(new Runnable() { | |
|
Ted C
2017/04/22 20:17:06
same question as the other init, do you want this
gone
2017/04/23 21:00:34
Moved it to when the FirstRunActivity marks itself
| |
| 218 @Override | |
| 219 public void run() { | |
| 220 // Update the search engine name cached by the widget. | |
| 221 SearchWidgetProvider.updateCachedEngineName(); | |
| 222 } | |
| 223 }); | |
| 224 } | |
| 216 | 225 |
| 217 @Override | 226 @Override |
| 218 public void onStartupFailure() { | 227 public void onStartupFailure() { |
| 219 ProcessInitException e = | 228 ProcessInitException e = |
| 220 new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_STARTU P_FAILED); | 229 new ProcessInitException(LoaderErrors.LOADER_ERROR_NATIVE_STARTU P_FAILED); |
| 221 ChromeApplication.reportStartupErrorAndExit(e); | 230 ChromeApplication.reportStartupErrorAndExit(e); |
| 222 } | 231 } |
| 223 | 232 |
| 224 /** | 233 /** |
| 225 * Extending classes should override {@link AsyncInitializationActivity#preI nflationStartup()}, | 234 * Extending classes should override {@link AsyncInitializationActivity#preI nflationStartup()}, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 656 getDecorView().setVisibility(View.GONE); | 665 getDecorView().setVisibility(View.GONE); |
| 657 } | 666 } |
| 658 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi stener); | 667 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi stener); |
| 659 } | 668 } |
| 660 }); | 669 }); |
| 661 return true; | 670 return true; |
| 662 } | 671 } |
| 663 }; | 672 }; |
| 664 } | 673 } |
| 665 } | 674 } |
| OLD | NEW |