| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/gtk/import_dialog_gtk.h" | 5 #include "chrome/browser/gtk/import_dialog_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "chrome/common/gtk_util.h" | 9 #include "chrome/common/gtk_util.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Build the dialog. | 30 // Build the dialog. |
| 31 dialog_ = gtk_dialog_new_with_buttons( | 31 dialog_ = gtk_dialog_new_with_buttons( |
| 32 l10n_util::GetStringUTF8(IDS_IMPORT_SETTINGS_TITLE).c_str(), | 32 l10n_util::GetStringUTF8(IDS_IMPORT_SETTINGS_TITLE).c_str(), |
| 33 parent, | 33 parent, |
| 34 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 34 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
| 35 GTK_STOCK_CANCEL, | 35 GTK_STOCK_CANCEL, |
| 36 GTK_RESPONSE_REJECT, | 36 GTK_RESPONSE_REJECT, |
| 37 l10n_util::GetStringUTF8(IDS_IMPORT_COMMIT).c_str(), | 37 l10n_util::GetStringUTF8(IDS_IMPORT_COMMIT).c_str(), |
| 38 GTK_RESPONSE_ACCEPT, | 38 GTK_RESPONSE_ACCEPT, |
| 39 NULL); | 39 NULL); |
| 40 importer_host_->set_parent_window(GTK_WINDOW(dialog_)); |
| 40 | 41 |
| 41 // TODO(rahulk): find how to set size properly so that the dialog | 42 // TODO(rahulk): find how to set size properly so that the dialog |
| 42 // box width is at least enough to display full title. | 43 // box width is at least enough to display full title. |
| 43 gtk_widget_set_size_request(dialog_, 300, -1); | 44 gtk_widget_set_size_request(dialog_, 300, -1); |
| 44 | 45 |
| 45 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; | 46 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; |
| 46 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 47 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
| 47 | 48 |
| 48 GtkWidget* combo_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); | 49 GtkWidget* combo_hbox = gtk_hbox_new(FALSE, gtk_util::kLabelSpacing); |
| 49 GtkWidget* from = gtk_label_new( | 50 GtkWidget* from = gtk_label_new( |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const ProfileInfo& source_profile = | 117 const ProfileInfo& source_profile = |
| 117 importer_host_->GetSourceProfileInfoAt( | 118 importer_host_->GetSourceProfileInfoAt( |
| 118 gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); | 119 gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); |
| 119 StartImportingWithUI(parent_, items, importer_host_.get(), | 120 StartImportingWithUI(parent_, items, importer_host_.get(), |
| 120 source_profile, profile_, this, false); | 121 source_profile, profile_, this, false); |
| 121 } | 122 } |
| 122 } else { | 123 } else { |
| 123 ImportCanceled(); | 124 ImportCanceled(); |
| 124 } | 125 } |
| 125 } | 126 } |
| OLD | NEW |