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/edit_search_engine_dialog.h" | 5 #include "chrome/browser/gtk/edit_search_engine_dialog.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 controller_->template_url() ? | 72 controller_->template_url() ? |
73 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : | 73 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : |
74 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE).c_str(), | 74 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE).c_str(), |
75 parent_window, | 75 parent_window, |
76 static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), | 76 static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
77 GTK_STOCK_CANCEL, | 77 GTK_STOCK_CANCEL, |
78 GTK_RESPONSE_CANCEL, | 78 GTK_RESPONSE_CANCEL, |
79 NULL); | 79 NULL); |
80 | 80 |
81 ok_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), | 81 ok_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), |
82 GTK_STOCK_OK, GTK_RESPONSE_OK); | 82 controller_->template_url() ? |
| 83 GTK_STOCK_SAVE : |
| 84 GTK_STOCK_ADD, |
| 85 GTK_RESPONSE_OK); |
83 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); | 86 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); |
84 | 87 |
85 // The dialog layout hierarchy looks like this: | 88 // The dialog layout hierarchy looks like this: |
86 // | 89 // |
87 // \ GtkVBox |dialog_->vbox| | 90 // \ GtkVBox |dialog_->vbox| |
88 // +-\ GtkTable |controls| | 91 // +-\ GtkTable |controls| |
89 // | +-\ row 0 | 92 // | +-\ row 0 |
90 // | | +- GtkLabel | 93 // | | +- GtkLabel |
91 // | | +-\ GtkHBox | 94 // | | +-\ GtkHBox |
92 // | | +- GtkEntry |title_entry_| | 95 // | | +- GtkEntry |title_entry_| |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 window->controller_->CleanUpCancelledAdd(); | 250 window->controller_->CleanUpCancelledAdd(); |
248 } | 251 } |
249 gtk_widget_destroy(window->dialog_); | 252 gtk_widget_destroy(window->dialog_); |
250 } | 253 } |
251 | 254 |
252 // static | 255 // static |
253 void EditSearchEngineDialog::OnWindowDestroy( | 256 void EditSearchEngineDialog::OnWindowDestroy( |
254 GtkWidget* widget, EditSearchEngineDialog* window) { | 257 GtkWidget* widget, EditSearchEngineDialog* window) { |
255 MessageLoop::current()->DeleteSoon(FROM_HERE, window); | 258 MessageLoop::current()->DeleteSoon(FROM_HERE, window); |
256 } | 259 } |
OLD | NEW |