OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.bookmarkimport; |
| 6 |
| 7 import android.app.Dialog; |
| 8 import android.app.DialogFragment; |
| 9 import android.content.DialogInterface; |
| 10 import android.os.Bundle; |
| 11 import android.support.v7.app.AlertDialog; |
| 12 |
| 13 import com.google.android.apps.chrome.R; |
| 14 |
| 15 /** |
| 16 * This dialog to confirm user want to import bookmarks. |
| 17 */ |
| 18 public class ImportBookmarksAlertDialog extends DialogFragment |
| 19 implements DialogInterface.OnClickListener { |
| 20 |
| 21 @Override |
| 22 public Dialog onCreateDialog(Bundle savedInstanceState) { |
| 23 AlertDialog.Builder alertDialogBuilder = |
| 24 new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme) |
| 25 .setTitle(R.string.import_bookmarks) |
| 26 .setPositiveButton(R.string.import_bookmarks_ok, this) |
| 27 .setNegativeButton(R.string.cancel, this) |
| 28 .setMessage(R.string.import_bookmarks_prompt); |
| 29 return alertDialogBuilder.create(); |
| 30 } |
| 31 |
| 32 private void importBookmarks() { |
| 33 ImportBookmarksProgressDialog progressDialog = new ImportBookmarksProgre
ssDialog(); |
| 34 progressDialog.show(getActivity().getFragmentManager(), null); |
| 35 } |
| 36 |
| 37 @Override |
| 38 public void onClick(DialogInterface dialog, int which) { |
| 39 if (which == AlertDialog.BUTTON_POSITIVE) importBookmarks(); |
| 40 } |
| 41 } |
OLD | NEW |