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