| 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/options/passwords_exceptions_window_gtk.h" | 5 #include "chrome/browser/gtk/options/passwords_exceptions_window_gtk.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 "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 gtk_notebook_append_page( | 85 gtk_notebook_append_page( |
| 86 GTK_NOTEBOOK(notebook_), | 86 GTK_NOTEBOOK(notebook_), |
| 87 exceptions_page_.get_page_widget(), | 87 exceptions_page_.get_page_widget(), |
| 88 gtk_label_new(l10n_util::GetStringUTF8( | 88 gtk_label_new(l10n_util::GetStringUTF8( |
| 89 IDS_PASSWORDS_EXCEPTIONS_TAB_TITLE).c_str())); | 89 IDS_PASSWORDS_EXCEPTIONS_TAB_TITLE).c_str())); |
| 90 | 90 |
| 91 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); | 91 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_); |
| 92 | 92 |
| 93 gtk_widget_realize(dialog_); | 93 gtk_widget_realize(dialog_); |
| 94 int width = 1, height = 1; | 94 gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_), |
| 95 gtk_util::GetWidgetSizeFromResources( | 95 IDS_PASSWORDS_DIALOG_WIDTH_CHARS, |
| 96 dialog_, | 96 IDS_PASSWORDS_DIALOG_HEIGHT_LINES, |
| 97 IDS_PASSWORDS_DIALOG_WIDTH_CHARS, | 97 true); |
| 98 IDS_PASSWORDS_DIALOG_HEIGHT_LINES, | |
| 99 &width, &height); | |
| 100 gtk_window_set_default_size(GTK_WINDOW(dialog_), width, height); | |
| 101 | 98 |
| 102 // We only have one button and don't do any special handling, so just hook it | 99 // We only have one button and don't do any special handling, so just hook it |
| 103 // directly to gtk_widget_destroy. | 100 // directly to gtk_widget_destroy. |
| 104 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); | 101 g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL); |
| 105 | 102 |
| 106 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); | 103 g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this); |
| 107 | 104 |
| 108 gtk_widget_show_all(dialog_); | 105 gtk_widget_show_all(dialog_); |
| 109 } | 106 } |
| 110 | 107 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 131 // Factory/finder method: | 128 // Factory/finder method: |
| 132 | 129 |
| 133 void ShowPasswordsExceptionsWindow(Profile* profile) { | 130 void ShowPasswordsExceptionsWindow(Profile* profile) { |
| 134 DCHECK(profile); | 131 DCHECK(profile); |
| 135 // If there's already an existing passwords and exceptions window, use it. | 132 // If there's already an existing passwords and exceptions window, use it. |
| 136 if (!passwords_exceptions_window) { | 133 if (!passwords_exceptions_window) { |
| 137 passwords_exceptions_window = new PasswordsExceptionsWindowGtk(profile); | 134 passwords_exceptions_window = new PasswordsExceptionsWindowGtk(profile); |
| 138 } | 135 } |
| 139 passwords_exceptions_window->Show(); | 136 passwords_exceptions_window->Show(); |
| 140 } | 137 } |
| OLD | NEW |