diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:00:26 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 19:00:26 +0000 |
commit | c9d8d1838b2e669c9687b00f9642c3d350032362 (patch) | |
tree | 3a1f94a58956503d063dd74e3b1d4d64d6c2c52e /chrome/browser/gtk/import_dialog_gtk.cc | |
parent | b981effe484cfb2ebe09a6903a8bc6a3e1f4c05c (diff) | |
download | chromium_src-c9d8d1838b2e669c9687b00f9642c3d350032362.zip chromium_src-c9d8d1838b2e669c9687b00f9642c3d350032362.tar.gz chromium_src-c9d8d1838b2e669c9687b00f9642c3d350032362.tar.bz2 |
If there is nothing to import, return.
Fixed DCHECK.
BUG=13246
TEST=In chrome debug build, do not select anything to import and click "Import".
Review URL: http://codereview.chromium.org/119104
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17748 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/import_dialog_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/import_dialog_gtk.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/chrome/browser/gtk/import_dialog_gtk.cc b/chrome/browser/gtk/import_dialog_gtk.cc index 43c2df1..172eab4 100644 --- a/chrome/browser/gtk/import_dialog_gtk.cc +++ b/chrome/browser/gtk/import_dialog_gtk.cc @@ -71,18 +71,23 @@ ImportDialogGtk::ImportDialogGtk(GtkWindow* parent, Profile* profile) : bookmarks_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_IMPORT_FAVORITES_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), bookmarks_, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(bookmarks_), TRUE); search_engines_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_IMPORT_SEARCH_ENGINES_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), search_engines_, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(search_engines_), TRUE); passwords_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_IMPORT_PASSWORDS_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), passwords_, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(passwords_), TRUE); history_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_IMPORT_HISTORY_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), history_, FALSE, FALSE, 0); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(history_), TRUE); + gtk_box_pack_start(GTK_BOX(content_area), vbox, FALSE, FALSE, 0); g_signal_connect(dialog_, "response", @@ -104,10 +109,15 @@ void ImportDialogGtk::OnDialogResponse(GtkWidget* widget, int response) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(history_))) items |= HISTORY; - const ProfileInfo& source_profile = importer_host_->GetSourceProfileInfoAt( - gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); - StartImportingWithUI(parent_, items, importer_host_.get(), - source_profile, profile_, this, false); + if (items == 0) { + ImportComplete(); + } else { + const ProfileInfo& source_profile = + importer_host_->GetSourceProfileInfoAt( + gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); + StartImportingWithUI(parent_, items, importer_host_.get(), + source_profile, profile_, this, false); + } } else { ImportCanceled(); } |