| 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.Fragment; | 7 import android.app.Fragment; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.SharedPreferences; | 9 import android.content.SharedPreferences; |
| 10 import android.text.TextUtils; | 10 import android.text.TextUtils; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 UmaSessionStats.changeMetricsReportingConsent(allowCrashUpload); | 63 UmaSessionStats.changeMetricsReportingConsent(allowCrashUpload); |
| 64 ContextUtils.getAppSharedPreferences() | 64 ContextUtils.getAppSharedPreferences() |
| 65 .edit() | 65 .edit() |
| 66 .putBoolean(CACHED_TOS_ACCEPTED_PREF, true) | 66 .putBoolean(CACHED_TOS_ACCEPTED_PREF, true) |
| 67 .apply(); | 67 .apply(); |
| 68 PrefServiceBridge.getInstance().setEulaAccepted(); | 68 PrefServiceBridge.getInstance().setEulaAccepted(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 @Override | 71 @Override |
| 72 public boolean isDefaultAccountName(Context appContext, String accountName)
{ | 72 public boolean isDefaultAccountName(Context appContext, String accountName)
{ |
| 73 List<String> accountNames = AccountManagerHelper.get().getGoogleAccountN
ames(); | 73 List<String> accountNames = AccountManagerHelper.get(appContext).getGoog
leAccountNames(); |
| 74 return accountNames != null | 74 return accountNames != null |
| 75 && accountNames.size() > 0 | 75 && accountNames.size() > 0 |
| 76 && TextUtils.equals(accountNames.get(0), accountName); | 76 && TextUtils.equals(accountNames.get(0), accountName); |
| 77 } | 77 } |
| 78 | 78 |
| 79 @Override | 79 @Override |
| 80 public void openAccountAdder(Fragment fragment) { | 80 public void openAccountAdder(Fragment fragment) { |
| 81 AccountAdder.getInstance().addAccount(fragment, AccountAdder.ADD_ACCOUNT
_RESULT); | 81 AccountAdder.getInstance().addAccount(fragment, AccountAdder.ADD_ACCOUNT
_RESULT); |
| 82 } | 82 } |
| 83 } | 83 } |
| OLD | NEW |