| 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_keyword_controller.h" | 5 #include "chrome/browser/gtk/edit_keyword_controller.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 : EditKeywordControllerBase(template_url, delegate, profile) { | 70 : EditKeywordControllerBase(template_url, delegate, profile) { |
| 71 Init(parent_window); | 71 Init(parent_window); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void EditKeywordController::Init(GtkWindow* parent_window) { | 74 void EditKeywordController::Init(GtkWindow* parent_window) { |
| 75 dialog_ = gtk_dialog_new_with_buttons( | 75 dialog_ = gtk_dialog_new_with_buttons( |
| 76 l10n_util::GetStringUTF8( | 76 l10n_util::GetStringUTF8( |
| 77 template_url() ? | 77 template_url() ? |
| 78 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : | 78 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : |
| 79 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE).c_str(), | 79 IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE).c_str(), |
| 80 // In views, this is window-modal. GTK only does app-modal which is | |
| 81 // overkill, so we'll just settle for being a non-modal transient. | |
| 82 parent_window, | 80 parent_window, |
| 83 GTK_DIALOG_NO_SEPARATOR, | 81 static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR), |
| 84 GTK_STOCK_CANCEL, | 82 GTK_STOCK_CANCEL, |
| 85 GTK_RESPONSE_CANCEL, | 83 GTK_RESPONSE_CANCEL, |
| 86 NULL); | 84 NULL); |
| 87 | 85 |
| 88 ok_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), | 86 ok_button_ = gtk_dialog_add_button(GTK_DIALOG(dialog_), |
| 89 GTK_STOCK_OK, GTK_RESPONSE_OK); | 87 GTK_STOCK_OK, GTK_RESPONSE_OK); |
| 90 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); | 88 gtk_dialog_set_default_response(GTK_DIALOG(dialog_), GTK_RESPONSE_OK); |
| 91 | 89 |
| 92 // The dialog layout hierarchy looks like this: | 90 // The dialog layout hierarchy looks like this: |
| 93 // | 91 // |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 window->CleanUpCancelledAdd(); | 241 window->CleanUpCancelledAdd(); |
| 244 } | 242 } |
| 245 gtk_widget_destroy(window->dialog_); | 243 gtk_widget_destroy(window->dialog_); |
| 246 } | 244 } |
| 247 | 245 |
| 248 // static | 246 // static |
| 249 void EditKeywordController::OnWindowDestroy( | 247 void EditKeywordController::OnWindowDestroy( |
| 250 GtkWidget* widget, EditKeywordController* window) { | 248 GtkWidget* widget, EditKeywordController* window) { |
| 251 MessageLoop::current()->DeleteSoon(FROM_HERE, window); | 249 MessageLoop::current()->DeleteSoon(FROM_HERE, window); |
| 252 } | 250 } |
| OLD | NEW |