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.text.TextUtils; | 10 import android.text.TextUtils; |
11 import android.text.method.LinkMovementMethod; | 11 import android.text.method.LinkMovementMethod; |
12 import android.util.AttributeSet; | 12 import android.util.AttributeSet; |
13 import android.view.View; | 13 import android.view.View; |
14 import android.widget.Button; | 14 import android.widget.Button; |
15 import android.widget.FrameLayout; | 15 import android.widget.FrameLayout; |
16 import android.widget.ImageView; | 16 import android.widget.ImageView; |
17 import android.widget.TextView; | 17 import android.widget.TextView; |
18 | 18 |
19 import org.chromium.base.ApiCompatibilityUtils; | 19 import org.chromium.base.ApiCompatibilityUtils; |
20 import org.chromium.base.metrics.RecordUserAction; | 20 import org.chromium.base.metrics.RecordUserAction; |
21 import org.chromium.chrome.R; | 21 import org.chromium.chrome.R; |
22 import org.chromium.chrome.browser.firstrun.ProfileDataCache; | 22 import org.chromium.chrome.browser.firstrun.ProfileDataCache; |
| 23 import org.chromium.chrome.browser.ntp.NtpColorUtils; |
23 import org.chromium.chrome.browser.preferences.PrefServiceBridge; | 24 import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
24 import org.chromium.chrome.browser.profiles.ProfileDownloader; | 25 import org.chromium.chrome.browser.profiles.ProfileDownloader; |
25 import org.chromium.chrome.browser.signin.AccountTrackerService.OnSystemAccounts
SeededListener; | 26 import org.chromium.chrome.browser.signin.AccountTrackerService.OnSystemAccounts
SeededListener; |
26 import org.chromium.chrome.browser.sync.SyncUserDataWiper; | 27 import org.chromium.chrome.browser.sync.SyncUserDataWiper; |
27 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog; | 28 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog; |
28 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog.ImportSyn
cType; | 29 import org.chromium.chrome.browser.sync.ui.ConfirmImportSyncDataDialog.ImportSyn
cType; |
29 import org.chromium.signin.InvestigatedScenario; | 30 import org.chromium.signin.InvestigatedScenario; |
30 import org.chromium.sync.signin.AccountManagerHelper; | 31 import org.chromium.sync.signin.AccountManagerHelper; |
31 import org.chromium.ui.text.NoUnderlineClickableSpan; | 32 import org.chromium.ui.text.NoUnderlineClickableSpan; |
32 import org.chromium.ui.text.SpanApplier; | 33 import org.chromium.ui.text.SpanApplier; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 187 } |
187 } | 188 } |
188 } | 189 } |
189 | 190 |
190 /** | 191 /** |
191 * Changes the visuals slightly for when this view appears in the recent tab
s page instead of | 192 * Changes the visuals slightly for when this view appears in the recent tab
s page instead of |
192 * in first run. | 193 * in first run. |
193 * This is currently used in the Recent Tabs Promo and the bookmarks page. | 194 * This is currently used in the Recent Tabs Promo and the bookmarks page. |
194 */ | 195 */ |
195 public void configureForRecentTabsOrBookmarksPage() { | 196 public void configureForRecentTabsOrBookmarksPage() { |
196 setBackgroundResource(R.color.ntp_bg); | 197 setBackgroundColor(NtpColorUtils.getBackgroundColorResource(getResources
())); |
197 mCancelButtonTextId = R.string.cancel; | 198 mCancelButtonTextId = R.string.cancel; |
198 setUpCancelButton(); | 199 setUpCancelButton(); |
199 } | 200 } |
200 | 201 |
201 /** | 202 /** |
202 * Enable or disable UI elements so the user can't select an account, cancel
, etc. | 203 * Enable or disable UI elements so the user can't select an account, cancel
, etc. |
203 * | 204 * |
204 * @param enabled The state to change to. | 205 * @param enabled The state to change to. |
205 */ | 206 */ |
206 public void setButtonsEnabled(boolean enabled) { | 207 public void setButtonsEnabled(boolean enabled) { |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 mPositiveButton.setTextColor( | 529 mPositiveButton.setTextColor( |
529 ApiCompatibilityUtils.getColor(getResources(), R.color.fre_text_
color)); | 530 ApiCompatibilityUtils.getColor(getResources(), R.color.fre_text_
color)); |
530 mPositiveButton.setAlpha(0.26f); | 531 mPositiveButton.setAlpha(0.26f); |
531 mPositiveButton.setEnabled(false); | 532 mPositiveButton.setEnabled(false); |
532 } | 533 } |
533 | 534 |
534 private String getSelectedAccountName() { | 535 private String getSelectedAccountName() { |
535 return mAccountNames.get(mSigninChooseView.getSelectedAccountPosition())
; | 536 return mAccountNames.get(mSigninChooseView.getSelectedAccountPosition())
; |
536 } | 537 } |
537 } | 538 } |
OLD | NEW |