Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(898)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java

Issue 1521013002: Make the ChromeBrowserInitializer the only way to start the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yfriedman@ comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java b/chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java
index a6cd90740575779039179669ae320ed0ec4a831a..3a6a2196a674d0928fd39827df7fa153d5855ac9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/AccountsChangedReceiver.java
@@ -18,6 +18,9 @@ import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.base.library_loader.LibraryProcessType;
import org.chromium.base.library_loader.ProcessInitException;
import org.chromium.chrome.browser.ChromeApplication;
+import org.chromium.chrome.browser.init.BrowserParts;
+import org.chromium.chrome.browser.init.ChromeBrowserInitializer;
+import org.chromium.chrome.browser.init.EmptyBrowserParts;
import org.chromium.chrome.browser.signin.AccountTrackerService;
import org.chromium.chrome.browser.signin.SigninHelper;
import org.chromium.content.browser.BrowserStartupController;
@@ -98,9 +101,9 @@ public class AccountsChangedReceiver extends BroadcastReceiver {
@SuppressFBWarnings("DM_EXIT")
private static void startBrowserIfNeededAndValidateAccounts(final Context context) {
- StartupCallback validateAccountsCallback = new StartupCallback() {
+ BrowserParts parts = new EmptyBrowserParts() {
@Override
- public void onSuccess(boolean alreadyStarted) {
+ public void finishNativeInitialization() {
ThreadUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
@@ -108,16 +111,17 @@ public class AccountsChangedReceiver extends BroadcastReceiver {
}
});
}
+
@Override
- public void onFailure() {
+ public void onStartupFailure() {
// Startup failed. So notify SigninHelper of changed accounts via
// shared prefs.
SigninHelper.markAccountsChangedPref(context);
}
};
try {
- ((ChromeApplication) context)
- .startChromeBrowserProcessesAsync(validateAccountsCallback);
+ ChromeBrowserInitializer.getInstance(context).handlePreNativeStartup(parts);
+ ChromeBrowserInitializer.getInstance(context).handlePostNativeStartup(true, parts);
} catch (ProcessInitException e) {
Log.e(TAG, "Unable to load native library.", e);
ChromeApplication.reportStartupErrorAndExit(e);

Powered by Google App Engine
This is Rietveld 408576698