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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java

Issue 2784353002: Android: Remove GetApplicationContext part 2 (Closed)
Patch Set: Fix tests Created 3 years, 8 months 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 unified diff | Download patch
OLDNEW
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.signin; 5 package org.chromium.chrome.browser.signin;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.FragmentManager; 8 import android.app.FragmentManager;
9 import android.content.Context; 9 import android.content.Context;
10 import android.graphics.Bitmap; 10 import android.graphics.Bitmap;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 private AccountSigninConfirmationView mSigninConfirmationView; 123 private AccountSigninConfirmationView mSigninConfirmationView;
124 private ImageView mSigninAccountImage; 124 private ImageView mSigninAccountImage;
125 private TextView mSigninAccountName; 125 private TextView mSigninAccountName;
126 private TextView mSigninAccountEmail; 126 private TextView mSigninAccountEmail;
127 private TextView mSigninPersonalizeServiceDescription; 127 private TextView mSigninPersonalizeServiceDescription;
128 private TextView mSigninSettingsControl; 128 private TextView mSigninSettingsControl;
129 129
130 public AccountSigninView(Context context, AttributeSet attrs) { 130 public AccountSigninView(Context context, AttributeSet attrs) {
131 super(context, attrs); 131 super(context, attrs);
132 mAccountManagerHelper = AccountManagerHelper.get(getContext().getApplica tionContext()); 132 mAccountManagerHelper = AccountManagerHelper.get();
133 } 133 }
134 134
135 /** 135 /**
136 * Initializes this view with profile data cache, delegate and listener. 136 * Initializes this view with profile data cache, delegate and listener.
137 * @param profileData ProfileDataCache that will be used to call to retrieve user account info. 137 * @param profileData ProfileDataCache that will be used to call to retrieve user account info.
138 * @param delegate The UI object creation delegate. 138 * @param delegate The UI object creation delegate.
139 * @param listener The account selection event listener. 139 * @param listener The account selection event listener.
140 */ 140 */
141 public void init(ProfileDataCache profileData, Delegate delegate, Listener l istener) { 141 public void init(ProfileDataCache profileData, Delegate delegate, Listener l istener) {
142 mProfileData = profileData; 142 mProfileData = profileData;
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 SpanApplier.applySpans(getSettingsControlDescription(mIsChildAcc ount), 441 SpanApplier.applySpans(getSettingsControlDescription(mIsChildAcc ount),
442 new SpanInfo(SETTINGS_LINK_OPEN, SETTINGS_LINK_CLOSE, se ttingsSpan))); 442 new SpanInfo(SETTINGS_LINK_OPEN, SETTINGS_LINK_CLOSE, se ttingsSpan)));
443 } 443 }
444 444
445 private void showConfirmSigninPageAccountTrackerServiceCheck() { 445 private void showConfirmSigninPageAccountTrackerServiceCheck() {
446 // Disable the buttons to prevent them being clicked again while waiting for the callbacks. 446 // Disable the buttons to prevent them being clicked again while waiting for the callbacks.
447 setButtonsEnabled(false); 447 setButtonsEnabled(false);
448 448
449 // Ensure that the AccountTrackerService has a fully up to date GAIA id <-> email mapping, 449 // Ensure that the AccountTrackerService has a fully up to date GAIA id <-> email mapping,
450 // as this is needed for the previous account check. 450 // as this is needed for the previous account check.
451 if (AccountTrackerService.get(getContext()).checkAndSeedSystemAccounts() ) { 451 if (AccountTrackerService.get().checkAndSeedSystemAccounts()) {
452 showConfirmSigninPagePreviousAccountCheck(); 452 showConfirmSigninPagePreviousAccountCheck();
453 } else { 453 } else {
454 AccountTrackerService.get(getContext()).addSystemAccountsSeededListe ner( 454 AccountTrackerService.get().addSystemAccountsSeededListener(
455 new OnSystemAccountsSeededListener() { 455 new OnSystemAccountsSeededListener() {
456 @Override 456 @Override
457 public void onSystemAccountsSeedingComplete() { 457 public void onSystemAccountsSeedingComplete() {
458 AccountTrackerService.get(getContext()) 458 AccountTrackerService.get().removeSystemAccountsSeed edListener(this);
459 .removeSystemAccountsSeededListener(this);
460 showConfirmSigninPagePreviousAccountCheck(); 459 showConfirmSigninPagePreviousAccountCheck();
461 } 460 }
462 461
463 @Override 462 @Override
464 public void onSystemAccountsChanged() {} 463 public void onSystemAccountsChanged() {}
465 }); 464 });
466 } 465 }
467 } 466 }
468 467
469 private void showConfirmSigninPagePreviousAccountCheck() { 468 private void showConfirmSigninPagePreviousAccountCheck() {
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 * @return Whether the view is in "no choice, just a confirmation" forced-ac count mode. 628 * @return Whether the view is in "no choice, just a confirmation" forced-ac count mode.
630 */ 629 */
631 public boolean isInForcedAccountMode() { 630 public boolean isInForcedAccountMode() {
632 return mForcedAccountName != null; 631 return mForcedAccountName != null;
633 } 632 }
634 633
635 private String getSelectedAccountName() { 634 private String getSelectedAccountName() {
636 return mAccountNames.get(mSigninChooseView.getSelectedAccountPosition()) ; 635 return mAccountNames.get(mSigninChooseView.getSelectedAccountPosition()) ;
637 } 636 }
638 } 637 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698