| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/confirm_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/confirm_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 GtkWidget* row = gtk_hbox_new(FALSE, kImageViewSpacing); | 74 GtkWidget* row = gtk_hbox_new(FALSE, kImageViewSpacing); |
| 75 GtkWidget* icon_view = | 75 GtkWidget* icon_view = |
| 76 gtk_image_new_from_pixbuf(model_->GetIcon()->ToGdkPixbuf()); | 76 gtk_image_new_from_pixbuf(model_->GetIcon()->ToGdkPixbuf()); |
| 77 gtk_box_pack_start(GTK_BOX(row), icon_view, FALSE, FALSE, 0); | 77 gtk_box_pack_start(GTK_BOX(row), icon_view, FALSE, FALSE, 0); |
| 78 | 78 |
| 79 GtkWidget* title_label = theme_service->BuildLabel( | 79 GtkWidget* title_label = theme_service->BuildLabel( |
| 80 UTF16ToUTF8(model_->GetTitle()), ui::kGdkBlack); | 80 UTF16ToUTF8(model_->GetTitle()), ui::kGdkBlack); |
| 81 gtk_box_pack_start(GTK_BOX(row), title_label, FALSE, FALSE, 0); | 81 gtk_box_pack_start(GTK_BOX(row), title_label, FALSE, FALSE, 0); |
| 82 gtk_box_pack_start(GTK_BOX(row), gtk_label_new(NULL), TRUE, TRUE, 0); | 82 gtk_box_pack_start(GTK_BOX(row), gtk_label_new(NULL), TRUE, TRUE, 0); |
| 83 | 83 |
| 84 close_button_.reset(CustomDrawButton::CloseButton(theme_service)); | 84 close_button_.reset(CustomDrawButton::CloseButtonBubble(theme_service)); |
| 85 g_signal_connect(close_button_->widget(), "clicked", | 85 g_signal_connect(close_button_->widget(), "clicked", |
| 86 G_CALLBACK(OnCloseButtonThunk), this); | 86 G_CALLBACK(OnCloseButtonThunk), this); |
| 87 gtk_box_pack_end(GTK_BOX(row), close_button_->widget(), FALSE, FALSE, 0); | 87 gtk_box_pack_end(GTK_BOX(row), close_button_->widget(), FALSE, FALSE, 0); |
| 88 gtk_box_pack_start(GTK_BOX(content), row, FALSE, FALSE, 0); | 88 gtk_box_pack_start(GTK_BOX(content), row, FALSE, FALSE, 0); |
| 89 | 89 |
| 90 // Add the message label to the second row. | 90 // Add the message label to the second row. |
| 91 GtkWidget* message_label = theme_service->BuildLabel( | 91 GtkWidget* message_label = theme_service->BuildLabel( |
| 92 UTF16ToUTF8(model_->GetMessageText()), ui::kGdkBlack); | 92 UTF16ToUTF8(model_->GetMessageText()), ui::kGdkBlack); |
| 93 gtk_util::ForceFontSizePixels(message_label, kMessageTextSize); | 93 gtk_util::ForceFontSizePixels(message_label, kMessageTextSize); |
| 94 gtk_util::SetLabelWidth(message_label, kMaxMessageWidth); | 94 gtk_util::SetLabelWidth(message_label, kMaxMessageWidth); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 namespace chrome { | 181 namespace chrome { |
| 182 | 182 |
| 183 void ShowConfirmBubble(gfx::NativeView view, | 183 void ShowConfirmBubble(gfx::NativeView view, |
| 184 const gfx::Point& origin, | 184 const gfx::Point& origin, |
| 185 ConfirmBubbleModel* model) { | 185 ConfirmBubbleModel* model) { |
| 186 ConfirmBubbleGtk* bubble = new ConfirmBubbleGtk(view, origin, model); | 186 ConfirmBubbleGtk* bubble = new ConfirmBubbleGtk(view, origin, model); |
| 187 bubble->Show(); | 187 bubble->Show(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace chrome | 190 } // namespace chrome |
| OLD | NEW |