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.signin; | 5 package org.chromium.chrome.browser.signin; |
6 | 6 |
7 import android.app.FragmentManager; | 7 import android.app.FragmentManager; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.graphics.Bitmap; | 9 import android.graphics.Bitmap; |
10 import android.graphics.drawable.Drawable; | 10 import android.graphics.drawable.Drawable; |
11 import android.os.Bundle; | 11 import android.os.Bundle; |
12 import android.text.TextPaint; | 12 import android.text.TextPaint; |
13 import android.text.TextUtils; | 13 import android.text.TextUtils; |
14 import android.text.method.LinkMovementMethod; | 14 import android.text.method.LinkMovementMethod; |
15 import android.text.style.ClickableSpan; | |
16 import android.util.AttributeSet; | 15 import android.util.AttributeSet; |
17 import android.view.View; | 16 import android.view.View; |
18 import android.widget.AdapterView; | 17 import android.widget.AdapterView; |
19 import android.widget.ArrayAdapter; | 18 import android.widget.ArrayAdapter; |
20 import android.widget.Button; | 19 import android.widget.Button; |
21 import android.widget.ImageView; | 20 import android.widget.ImageView; |
22 import android.widget.LinearLayout; | 21 import android.widget.LinearLayout; |
23 import android.widget.Spinner; | 22 import android.widget.Spinner; |
24 import android.widget.TextView; | 23 import android.widget.TextView; |
25 | 24 |
26 import org.chromium.base.ApiCompatibilityUtils; | 25 import org.chromium.base.ApiCompatibilityUtils; |
27 import org.chromium.base.metrics.RecordUserAction; | 26 import org.chromium.base.metrics.RecordUserAction; |
28 import org.chromium.chrome.R; | 27 import org.chromium.chrome.R; |
29 import org.chromium.chrome.browser.firstrun.FirstRunView; | 28 import org.chromium.chrome.browser.firstrun.FirstRunView; |
30 import org.chromium.chrome.browser.firstrun.ImageCarousel; | 29 import org.chromium.chrome.browser.firstrun.ImageCarousel; |
31 import org.chromium.chrome.browser.firstrun.ImageCarousel.ImageCarouselPositionC hangeListener; | 30 import org.chromium.chrome.browser.firstrun.ImageCarousel.ImageCarouselPositionC hangeListener; |
32 import org.chromium.chrome.browser.firstrun.ProfileDataCache; | 31 import org.chromium.chrome.browser.firstrun.ProfileDataCache; |
33 import org.chromium.chrome.browser.preferences.PrefServiceBridge; | 32 import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
34 import org.chromium.chrome.browser.profiles.ProfileDownloader; | 33 import org.chromium.chrome.browser.profiles.ProfileDownloader; |
35 import org.chromium.chrome.browser.signin.AccountTrackerService.OnSystemAccounts SeededListener; | 34 import org.chromium.chrome.browser.signin.AccountTrackerService.OnSystemAccounts SeededListener; |
36 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog; | 35 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog; |
37 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog.ImportSyn cType; | 36 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog.ImportSyn cType; |
38 import org.chromium.signin.InvestigatedScenario; | 37 import org.chromium.signin.InvestigatedScenario; |
39 import org.chromium.sync.signin.AccountManagerHelper; | 38 import org.chromium.sync.signin.AccountManagerHelper; |
39 import org.chromium.ui.text.NoUnderlineClickableSpan; | |
40 import org.chromium.ui.text.SpanApplier; | 40 import org.chromium.ui.text.SpanApplier; |
41 import org.chromium.ui.text.SpanApplier.SpanInfo; | 41 import org.chromium.ui.text.SpanApplier.SpanInfo; |
42 | 42 |
43 import java.util.List; | 43 import java.util.List; |
44 | 44 |
45 /** | 45 /** |
46 * This view allows the user to select an account to log in to, add an account, | 46 * This view allows the user to select an account to log in to, add an account, |
47 * cancel account selection, etc. Users of this class should | 47 * cancel account selection, etc. Users of this class should |
48 * {@link AccountSigninView#setListener(Listener)} and | 48 * {@link AccountSigninView#setListener(Listener)} and |
49 * {@link AccountSigninView#setDelegate(Delegate)} after the view has been infla ted. | 49 * {@link AccountSigninView#setDelegate(Delegate)} after the view has been infla ted. |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
480 | 480 |
481 private void showConfirmSigninPage() { | 481 private void showConfirmSigninPage() { |
482 mSignedIn = true; | 482 mSignedIn = true; |
483 updateProfileName(); | 483 updateProfileName(); |
484 | 484 |
485 configureSpinner(false); | 485 configureSpinner(false); |
486 setUpConfirmButton(); | 486 setUpConfirmButton(); |
487 setUpUndoButton(); | 487 setUpUndoButton(); |
488 | 488 |
489 if (mShowSettingsSpan) { | 489 if (mShowSettingsSpan) { |
490 ClickableSpan settingsSpan = new ClickableSpan() { | 490 NoUnderlineClickableSpan settingsSpan = new NoUnderlineClickableSpan () { |
491 @Override | 491 @Override |
492 public void onClick(View widget) { | 492 public void onClick(View widget) { |
493 mListener.onAccountSelected(mAccountName, true); | 493 mListener.onAccountSelected(mAccountName, true); |
494 } | 494 } |
495 | 495 |
496 @Override | 496 @Override |
497 public void updateDrawState(TextPaint textPaint) { | 497 public void updateDrawState(TextPaint textPaint) { |
newt (away)
2016/03/10 02:45:14
Remove this method. Again, we shouldn't need to ov
juncai
2016/03/11 23:53:05
Done.
| |
498 super.updateDrawState(textPaint); | |
498 textPaint.setColor(getResources().getColor(R.color.ui_link_t ext_color)); | 499 textPaint.setColor(getResources().getColor(R.color.ui_link_t ext_color)); |
499 textPaint.setUnderlineText(false); | |
500 } | 500 } |
501 }; | 501 }; |
502 mDescriptionText.setText(SpanApplier.applySpans(getSignedInDescripti on(mIsChildAccount), | 502 mDescriptionText.setText(SpanApplier.applySpans(getSignedInDescripti on(mIsChildAccount), |
503 new SpanInfo(SETTINGS_LINK_OPEN, SETTINGS_LINK_CLOSE, settin gsSpan))); | 503 new SpanInfo(SETTINGS_LINK_OPEN, SETTINGS_LINK_CLOSE, settin gsSpan))); |
504 } else { | 504 } else { |
505 // If we aren't showing the span, get rid of the LINK1 annotations. | 505 // If we aren't showing the span, get rid of the LINK1 annotations. |
506 mDescriptionText.setText(getSignedInDescription(mIsChildAccount) | 506 mDescriptionText.setText(getSignedInDescription(mIsChildAccount) |
507 .replace(SETTINGS_LINK_OPEN, "") | 507 .replace(SETTINGS_LINK_OPEN, "") |
508 .replace(SETTINGS_LINK_CLOSE, "")); | 508 .replace(SETTINGS_LINK_CLOSE, "")); |
509 } | 509 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
661 public boolean isInForcedAccountMode() { | 661 public boolean isInForcedAccountMode() { |
662 return mForcedAccountName != null; | 662 return mForcedAccountName != null; |
663 } | 663 } |
664 | 664 |
665 @Override | 665 @Override |
666 public void onPositionChanged(int i) { | 666 public void onPositionChanged(int i) { |
667 mPositionSetProgrammatically = true; | 667 mPositionSetProgrammatically = true; |
668 mSpinner.setSelection(i); | 668 mSpinner.setSelection(i); |
669 } | 669 } |
670 } | 670 } |
OLD | NEW |