| 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.sync.ui; | 5 package org.chromium.chrome.browser.sync.ui; |
| 6 | 6 |
| 7 import android.accounts.Account; | 7 import android.accounts.Account; |
| 8 import android.app.Dialog; | 8 import android.app.Dialog; |
| 9 import android.app.DialogFragment; | 9 import android.app.DialogFragment; |
| 10 import android.app.FragmentManager; | 10 import android.app.FragmentManager; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 ChromeApplication.reportStartupErrorAndExit(e); | 50 ChromeApplication.reportStartupErrorAndExit(e); |
| 51 return; | 51 return; |
| 52 } | 52 } |
| 53 assert ProfileSyncService.get() != null; | 53 assert ProfileSyncService.get() != null; |
| 54 getFragmentManager().addOnBackStackChangedListener(this); | 54 getFragmentManager().addOnBackStackChangedListener(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 @Override | 57 @Override |
| 58 protected void onResume() { | 58 protected void onResume() { |
| 59 super.onResume(); | 59 super.onResume(); |
| 60 Account account = ChromeSigninController.get().getSignedInUser(); | 60 Account account = ChromeSigninController.get(this).getSignedInUser(); |
| 61 if (account == null) { | 61 if (account == null) { |
| 62 finish(); | 62 finish(); |
| 63 return; | 63 return; |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (!isShowingDialog(FRAGMENT_PASSPHRASE)) { | 66 if (!isShowingDialog(FRAGMENT_PASSPHRASE)) { |
| 67 if (ProfileSyncService.get().isEngineInitialized()) { | 67 if (ProfileSyncService.get().isEngineInitialized()) { |
| 68 displayPassphraseDialog(); | 68 displayPassphraseDialog(); |
| 69 } else { | 69 } else { |
| 70 addSyncStateChangedListener(); | 70 addSyncStateChangedListener(); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 */ | 154 */ |
| 155 public static class SpinnerDialogFragment extends DialogFragment { | 155 public static class SpinnerDialogFragment extends DialogFragment { |
| 156 @Override | 156 @Override |
| 157 public Dialog onCreateDialog(Bundle savedInstanceState) { | 157 public Dialog onCreateDialog(Bundle savedInstanceState) { |
| 158 ProgressDialog dialog = new ProgressDialog(getActivity()); | 158 ProgressDialog dialog = new ProgressDialog(getActivity()); |
| 159 dialog.setMessage(getResources().getString(R.string.sync_loading)); | 159 dialog.setMessage(getResources().getString(R.string.sync_loading)); |
| 160 return dialog; | 160 return dialog; |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| OLD | NEW |