| 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 : parent_(parent), profile_(profile), importer_host_(new ImporterHost()) { | 30 : parent_(parent), profile_(profile), importer_host_(new ImporterHost()) { |
| 31 // Build the dialog. | 31 // Build the dialog. |
| 32 dialog_ = gtk_dialog_new_with_buttons( | 32 dialog_ = gtk_dialog_new_with_buttons( |
| 33 l10n_util::GetStringUTF8(IDS_IMPORT_SETTINGS_TITLE).c_str(), | 33 l10n_util::GetStringUTF8(IDS_IMPORT_SETTINGS_TITLE).c_str(), |
| 34 parent, | 34 parent, |
| 35 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 35 (GtkDialogFlags) (GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
| 36 GTK_STOCK_CANCEL, | 36 GTK_STOCK_CANCEL, |
| 37 GTK_RESPONSE_REJECT, | 37 GTK_RESPONSE_REJECT, |
| 38 NULL); | 38 NULL); |
| 39 gtk_widget_realize(dialog_); | 39 gtk_widget_realize(dialog_); |
| 40 gtk_util::SetWindowWidthFromResources(GTK_WINDOW(dialog_), | 40 gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), |
| 41 IDS_IMPORT_DIALOG_WIDTH_CHARS, | 41 IDS_IMPORT_DIALOG_WIDTH_CHARS, |
| 42 /* resizable */ false); | 42 -1, // height |
| 43 false); // resizable |
| 43 importer_host_->set_parent_window(GTK_WINDOW(dialog_)); | 44 importer_host_->set_parent_window(GTK_WINDOW(dialog_)); |
| 44 | 45 |
| 45 // Add import button separately as we might need to disable it, if | 46 // Add import button separately as we might need to disable it, if |
| 46 // no supported browsers found. | 47 // no supported browsers found. |
| 47 GtkWidget* import_button = gtk_util::AddButtonToDialog(dialog_, | 48 GtkWidget* import_button = gtk_util::AddButtonToDialog(dialog_, |
| 48 l10n_util::GetStringUTF8(IDS_IMPORT_COMMIT).c_str(), | 49 l10n_util::GetStringUTF8(IDS_IMPORT_COMMIT).c_str(), |
| 49 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); | 50 GTK_STOCK_APPLY, GTK_RESPONSE_ACCEPT); |
| 50 GTK_WIDGET_SET_FLAGS(import_button, GTK_CAN_DEFAULT); | 51 GTK_WIDGET_SET_FLAGS(import_button, GTK_CAN_DEFAULT); |
| 51 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); | 52 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); |
| 52 | 53 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const ProfileInfo& source_profile = | 138 const ProfileInfo& source_profile = |
| 138 importer_host_->GetSourceProfileInfoAt( | 139 importer_host_->GetSourceProfileInfoAt( |
| 139 gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); | 140 gtk_combo_box_get_active(GTK_COMBO_BOX(combo_))); |
| 140 StartImportingWithUI(parent_, items, importer_host_.get(), | 141 StartImportingWithUI(parent_, items, importer_host_.get(), |
| 141 source_profile, profile_, this, false); | 142 source_profile, profile_, this, false); |
| 142 } | 143 } |
| 143 } else { | 144 } else { |
| 144 ImportCanceled(); | 145 ImportCanceled(); |
| 145 } | 146 } |
| 146 } | 147 } |
| OLD | NEW |