Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.cc

Issue 10826129: Media galleries: configuration dialog controller and GTK impl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix non-gtk builds Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/tab_modal_confirm_dialog_gtk.h" 5 #include "chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/ui/browser_dialogs.h" 9 #include "chrome/browser/ui/browser_dialogs.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents.h"
(...skipping 12 matching lines...) Expand all
23 TabContents* tab_contents) { 23 TabContents* tab_contents) {
24 new TabModalConfirmDialogGtk(delegate, tab_contents); 24 new TabModalConfirmDialogGtk(delegate, tab_contents);
25 } 25 }
26 26
27 } // namespace chrome 27 } // namespace chrome
28 28
29 TabModalConfirmDialogGtk::TabModalConfirmDialogGtk( 29 TabModalConfirmDialogGtk::TabModalConfirmDialogGtk(
30 TabModalConfirmDialogDelegate* delegate, 30 TabModalConfirmDialogDelegate* delegate,
31 TabContents* tab_contents) 31 TabContents* tab_contents)
32 : delegate_(delegate) { 32 : delegate_(delegate) {
33 dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaBorder); 33 dialog_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing);
34 gtk_box_set_spacing(GTK_BOX(dialog_), ui::kContentAreaSpacing);
35 GtkWidget* label = gtk_label_new( 34 GtkWidget* label = gtk_label_new(
36 UTF16ToUTF8(delegate->GetMessage()).c_str()); 35 UTF16ToUTF8(delegate->GetMessage()).c_str());
37 gfx::Image* icon = delegate->GetIcon(); 36 gfx::Image* icon = delegate->GetIcon();
38 GtkWidget* image = icon ? gtk_image_new_from_pixbuf(icon->ToGdkPixbuf()) 37 GtkWidget* image = icon ? gtk_image_new_from_pixbuf(icon->ToGdkPixbuf())
39 : gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION, 38 : gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,
40 GTK_ICON_SIZE_DIALOG); 39 GTK_ICON_SIZE_DIALOG);
41 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.0); 40 gtk_misc_set_alignment(GTK_MISC(image), 0.5, 0.0);
42 41
43 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 42 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
44 gtk_label_set_selectable(GTK_LABEL(label), TRUE); 43 gtk_label_set_selectable(GTK_LABEL(label), TRUE);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 gtk_widget_destroy(dialog_); 94 gtk_widget_destroy(dialog_);
96 } 95 }
97 96
98 void TabModalConfirmDialogGtk::OnAccept(GtkWidget* widget) { 97 void TabModalConfirmDialogGtk::OnAccept(GtkWidget* widget) {
99 delegate_->Accept(); 98 delegate_->Accept();
100 } 99 }
101 100
102 void TabModalConfirmDialogGtk::OnCancel(GtkWidget* widget) { 101 void TabModalConfirmDialogGtk::OnCancel(GtkWidget* widget) {
103 delegate_->Cancel(); 102 delegate_->Cancel();
104 } 103 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/extensions/media_galleries_dialog_gtk.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698