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

Side by Side Diff: chrome/browser/ui/input_window_dialog_gtk.cc

Issue 8372038: gtk/bookmarks: Update the label of some dialog buttons. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 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/input_window_dialog_gtk.h" 5 #include "chrome/browser/ui/input_window_dialog_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/ui/gtk/gtk_util.h" 10 #include "chrome/browser/ui/gtk/gtk_util.h"
11 #include "ui/base/gtk/gtk_signal.h" 11 #include "ui/base/gtk/gtk_signal.h"
12 12
13 InputWindowDialogGtk::InputWindowDialogGtk(GtkWindow* parent, 13 InputWindowDialogGtk::InputWindowDialogGtk(GtkWindow* parent,
14 const std::string& window_title, 14 const std::string& window_title,
15 const std::string& label, 15 const std::string& label,
16 const std::string& contents, 16 const std::string& contents,
17 Delegate* delegate) 17 Delegate* delegate,
18 bool is_new)
18 : dialog_(gtk_dialog_new_with_buttons( 19 : dialog_(gtk_dialog_new_with_buttons(
19 window_title.c_str(), 20 window_title.c_str(),
20 parent, 21 parent,
21 GTK_DIALOG_MODAL, 22 GTK_DIALOG_MODAL,
22 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, 23 GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT,
23 GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, 24 is_new ? GTK_STOCK_ADD : GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
24 NULL)), 25 NULL)),
25 delegate_(delegate) { 26 delegate_(delegate) {
26 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT); 27 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_ACCEPT);
27 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE); 28 gtk_dialog_set_has_separator(GTK_DIALOG(dialog_), FALSE);
28 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE); 29 gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);
29 30
30 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_)); 31 GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
31 gtk_box_set_spacing(GTK_BOX(content_area), 18); 32 gtk_box_set_spacing(GTK_BOX(content_area), 18);
32 33
33 GtkWidget* hbox = gtk_hbox_new(FALSE, 6); 34 GtkWidget* hbox = gtk_hbox_new(FALSE, 6);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 // Return true to prevent the gtk dialog from being destroyed. Close will 94 // Return true to prevent the gtk dialog from being destroyed. Close will
94 // destroy it for us and the default gtk_dialog_delete_event_handler() will 95 // destroy it for us and the default gtk_dialog_delete_event_handler() will
95 // force the destruction without us being able to stop it. 96 // force the destruction without us being able to stop it.
96 return TRUE; 97 return TRUE;
97 } 98 }
98 99
99 void InputWindowDialogGtk::OnWindowDestroy(GtkWidget* widget) { 100 void InputWindowDialogGtk::OnWindowDestroy(GtkWidget* widget) {
100 MessageLoop::current()->DeleteSoon(FROM_HERE, this); 101 MessageLoop::current()->DeleteSoon(FROM_HERE, this);
101 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698