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.sync.ui; | 5 package org.chromium.chrome.browser.sync.ui; |
6 | 6 |
7 import android.app.Dialog; | 7 import android.app.Dialog; |
8 import android.app.DialogFragment; | 8 import android.app.DialogFragment; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 private SpannableString getResetText() { | 188 private SpannableString getResetText() { |
189 final Context context = getActivity(); | 189 final Context context = getActivity(); |
190 return SpanApplier.applySpans( | 190 return SpanApplier.applySpans( |
191 context.getString(R.string.sync_passphrase_encryption_reset_inst
ructions), | 191 context.getString(R.string.sync_passphrase_encryption_reset_inst
ructions), |
192 new SpanInfo("<resetlink>", "</resetlink>", new ClickableSpan()
{ | 192 new SpanInfo("<resetlink>", "</resetlink>", new ClickableSpan()
{ |
193 @Override | 193 @Override |
194 public void onClick(View view) { | 194 public void onClick(View view) { |
195 Uri syncDashboardUrl = Uri.parse( | 195 Uri syncDashboardUrl = Uri.parse( |
196 context.getText(R.string.sync_dashboard_url).toS
tring()); | 196 context.getText(R.string.sync_dashboard_url).toS
tring()); |
197 Intent intent = new Intent(Intent.ACTION_VIEW, syncDashb
oardUrl); | 197 Intent intent = new Intent(Intent.ACTION_VIEW, syncDashb
oardUrl); |
198 intent.setPackage(BuildInfo.getPackageName(context)); | 198 intent.setPackage(BuildInfo.getPackageName()); |
199 IntentUtils.safePutBinderExtra( | 199 IntentUtils.safePutBinderExtra( |
200 intent, CustomTabsIntent.EXTRA_SESSION, null); | 200 intent, CustomTabsIntent.EXTRA_SESSION, null); |
201 context.startActivity(intent); | 201 context.startActivity(intent); |
202 } | 202 } |
203 })); | 203 })); |
204 } | 204 } |
205 | 205 |
206 @Override | 206 @Override |
207 public void onClick(DialogInterface dialog, int which) { | 207 public void onClick(DialogInterface dialog, int which) { |
208 if (which == DialogInterface.BUTTON_NEGATIVE) { | 208 if (which == DialogInterface.BUTTON_NEGATIVE) { |
(...skipping 29 matching lines...) Expand all Loading... |
238 private String getPassphraseDateStringFromArguments() { | 238 private String getPassphraseDateStringFromArguments() { |
239 long passphraseTime = getArguments().getLong(ARG_PASSPHRASE_TIME); | 239 long passphraseTime = getArguments().getLong(ARG_PASSPHRASE_TIME); |
240 DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); | 240 DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM); |
241 return df.format(new Date(passphraseTime)); | 241 return df.format(new Date(passphraseTime)); |
242 } | 242 } |
243 | 243 |
244 private boolean getIsEncryptEverythingAllowedFromArguments() { | 244 private boolean getIsEncryptEverythingAllowedFromArguments() { |
245 return getArguments().getBoolean(ARG_IS_ENCRYPT_EVERYTHING_ALLOWED); | 245 return getArguments().getBoolean(ARG_IS_ENCRYPT_EVERYTHING_ALLOWED); |
246 } | 246 } |
247 } | 247 } |
OLD | NEW |