| 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/download_request_dialog_delegate_gtk.h" | 5 #include "chrome/browser/gtk/download_request_dialog_delegate_gtk.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "chrome/browser/gtk/constrained_window_gtk.h" | 8 #include "chrome/browser/gtk/constrained_window_gtk.h" |
| 9 #include "chrome/common/gtk_util.h" | 9 #include "chrome/common/gtk_util.h" |
| 10 #include "chrome/browser/tab_contents/tab_contents.h" | 10 #include "chrome/browser/tab_contents/tab_contents.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DownloadRequestDialogDelegateGtk::~DownloadRequestDialogDelegateGtk() { | 22 DownloadRequestDialogDelegateGtk::~DownloadRequestDialogDelegateGtk() { |
| 23 root_.Destroy(); | 23 root_.Destroy(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 DownloadRequestDialogDelegateGtk::DownloadRequestDialogDelegateGtk( | 26 DownloadRequestDialogDelegateGtk::DownloadRequestDialogDelegateGtk( |
| 27 TabContents* tab, | 27 TabContents* tab, |
| 28 DownloadRequestManager::TabDownloadState* host) | 28 DownloadRequestManager::TabDownloadState* host) |
| 29 : DownloadRequestDialogDelegate(host), | 29 : DownloadRequestDialogDelegate(host), |
| 30 responded_(false) { | 30 responded_(false) { |
| 31 // Create dialog. | 31 // Create dialog. |
| 32 root_.Own(gtk_vbox_new(false, gtk_util::kContentAreaBorder)); | 32 root_.Own(gtk_vbox_new(NULL, gtk_util::kContentAreaBorder)); |
| 33 GtkWidget* label = gtk_label_new( | 33 GtkWidget* label = gtk_label_new( |
| 34 l10n_util::GetStringUTF8(IDS_MULTI_DOWNLOAD_WARNING).c_str()); | 34 l10n_util::GetStringUTF8(IDS_MULTI_DOWNLOAD_WARNING).c_str()); |
| 35 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); | 35 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); |
| 36 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | 36 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
| 37 gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0); | 37 gtk_box_pack_start(GTK_BOX(root_.get()), label, FALSE, FALSE, 0); |
| 38 | 38 |
| 39 GtkWidget* hbox = gtk_hbutton_box_new(); | 39 GtkWidget* hbox = gtk_hbutton_box_new(); |
| 40 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); | 40 gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_END); |
| 41 gtk_box_set_spacing(GTK_BOX(hbox), kButtonSpacing); | 41 gtk_box_set_spacing(GTK_BOX(hbox), kButtonSpacing); |
| 42 gtk_box_pack_start(GTK_BOX(root_.get()), hbox, FALSE, FALSE, 0); | 42 gtk_box_pack_start(GTK_BOX(root_.get()), hbox, FALSE, FALSE, 0); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 DoAccept(); | 85 DoAccept(); |
| 86 responded_ = true; | 86 responded_ = true; |
| 87 CloseWindow(); | 87 CloseWindow(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void DownloadRequestDialogDelegateGtk::OnDenyClicked() { | 90 void DownloadRequestDialogDelegateGtk::OnDenyClicked() { |
| 91 DoCancel(); | 91 DoCancel(); |
| 92 responded_ = true; | 92 responded_ = true; |
| 93 CloseWindow(); | 93 CloseWindow(); |
| 94 } | 94 } |
| OLD | NEW |