| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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.h" | 5 #include "chrome/browser/ui/input_window_dialog.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void InputWindowDialogGtk::Show() { | 93 void InputWindowDialogGtk::Show() { |
| 94 gtk_util::ShowDialog(dialog_); | 94 gtk_util::ShowDialog(dialog_); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void InputWindowDialogGtk::Close() { | 97 void InputWindowDialogGtk::Close() { |
| 98 // Under the model that we've inherited from Windows, dialogs can receive | 98 // Under the model that we've inherited from Windows, dialogs can receive |
| 99 // more than one Close() call inside the current message loop event. | 99 // more than one Close() call inside the current message loop event. |
| 100 if (dialog_) { | 100 if (dialog_) { |
| 101 gtk_widget_destroy(GTK_WIDGET(dialog_)); | 101 gtk_widget_destroy(dialog_); |
| 102 dialog_ = NULL; | 102 dialog_ = NULL; |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 void InputWindowDialogGtk::OnEntryChanged(GtkEditable* entry) { | 106 void InputWindowDialogGtk::OnEntryChanged(GtkEditable* entry) { |
| 107 std::wstring value(UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(entry)))); | 107 std::wstring value(UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(entry)))); |
| 108 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), | 108 gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog_), |
| 109 GTK_RESPONSE_ACCEPT, | 109 GTK_RESPONSE_ACCEPT, |
| 110 delegate_->IsValid(value)); | 110 delegate_->IsValid(value)); |
| 111 } | 111 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 138 const std::wstring& window_title, | 138 const std::wstring& window_title, |
| 139 const std::wstring& label, | 139 const std::wstring& label, |
| 140 const std::wstring& contents, | 140 const std::wstring& contents, |
| 141 Delegate* delegate) { | 141 Delegate* delegate) { |
| 142 return new InputWindowDialogGtk(parent, | 142 return new InputWindowDialogGtk(parent, |
| 143 WideToUTF8(window_title), | 143 WideToUTF8(window_title), |
| 144 WideToUTF8(label), | 144 WideToUTF8(label), |
| 145 WideToUTF8(contents), | 145 WideToUTF8(contents), |
| 146 delegate); | 146 delegate); |
| 147 } | 147 } |
| OLD | NEW |