| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/importer/import_lock_dialog_gtk.h" | 5 #include "chrome/browser/ui/gtk/importer/import_lock_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/importer/importer.h" | 10 #include "chrome/browser/importer/importer.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(), | 45 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_OK).c_str(), |
| 46 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); | 46 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT); |
| 47 | 47 |
| 48 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; | 48 GtkWidget* content_area = GTK_DIALOG(dialog_)->vbox; |
| 49 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); | 49 gtk_box_set_spacing(GTK_BOX(content_area), gtk_util::kContentAreaSpacing); |
| 50 GtkWidget* label = gtk_label_new( | 50 GtkWidget* label = gtk_label_new( |
| 51 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str()); | 51 l10n_util::GetStringUTF8(IDS_IMPORTER_LOCK_TEXT).c_str()); |
| 52 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | 52 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
| 53 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); | 53 gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0); |
| 54 | 54 |
| 55 g_signal_connect(dialog_, "response", | 55 g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this); |
| 56 G_CALLBACK(OnDialogResponseThunk), this); | |
| 57 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); | 56 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); |
| 58 gtk_widget_show_all(dialog_); | 57 gtk_widget_show_all(dialog_); |
| 59 } | 58 } |
| 60 | 59 |
| 61 ImportLockDialogGtk::~ImportLockDialogGtk() {} | 60 ImportLockDialogGtk::~ImportLockDialogGtk() {} |
| 62 | 61 |
| 63 void ImportLockDialogGtk::OnDialogResponse(GtkWidget* widget, int response) { | 62 void ImportLockDialogGtk::OnResponse(GtkWidget* dialog, int response_id) { |
| 64 if (response == GTK_RESPONSE_ACCEPT) { | 63 if (response_id == GTK_RESPONSE_ACCEPT) { |
| 65 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 64 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 66 importer_host_.get(), &ImporterHost::OnLockViewEnd, true)); | 65 importer_host_.get(), &ImporterHost::OnLockViewEnd, true)); |
| 67 } else { | 66 } else { |
| 68 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( | 67 MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( |
| 69 importer_host_.get(), &ImporterHost::OnLockViewEnd, false)); | 68 importer_host_.get(), &ImporterHost::OnLockViewEnd, false)); |
| 70 } | 69 } |
| 71 gtk_widget_destroy(dialog_); | 70 gtk_widget_destroy(dialog_); |
| 72 delete this; | 71 delete this; |
| 73 } | 72 } |
| OLD | NEW |