| 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" |
| 11 #include "chrome/browser/browser_process.h" | 11 #include "chrome/browser/browser_process.h" |
| 12 #include "chrome/browser/gtk/options/exceptions_page_gtk.h" | 12 #include "chrome/browser/gtk/options/exceptions_page_gtk.h" |
| 13 #include "chrome/browser/gtk/options/passwords_page_gtk.h" | 13 #include "chrome/browser/gtk/options/passwords_page_gtk.h" |
| 14 #include "chrome/browser/options_window.h" | 14 #include "chrome/browser/options_window.h" |
| 15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profile.h" |
| 16 #include "chrome/common/gtk_util.h" | 16 #include "chrome/common/gtk_util.h" |
| 17 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Initial width of the passwords and exceptions window. | 22 // Initial width of the passwords and exceptions window. |
| 23 const int kPasswordsExceptionsWindowInitialWidth = 530; | 23 const int kPasswordsExceptionsWindowInitialWidth = 565; |
| 24 const int kPasswordsExceptionsWindowInitialHeight = 400; |
| 24 | 25 |
| 25 } // anonymous namespace | 26 } // anonymous namespace |
| 26 | 27 |
| 27 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
| 28 // PasswordsExceptionsWindowGtk | 29 // PasswordsExceptionsWindowGtk |
| 29 // | 30 // |
| 30 // The contents of the Passwords and Exceptions dialog window. | 31 // The contents of the Passwords and Exceptions dialog window. |
| 31 | 32 |
| 32 class PasswordsExceptionsWindowGtk { | 33 class PasswordsExceptionsWindowGtk { |
| 33 public: | 34 public: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 dialog_ = gtk_dialog_new_with_buttons( | 72 dialog_ = gtk_dialog_new_with_buttons( |
| 72 l10n_util::GetStringUTF8(IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE).c_str(), | 73 l10n_util::GetStringUTF8(IDS_PASSWORDS_EXCEPTIONS_WINDOW_TITLE).c_str(), |
| 73 // Passwords and exceptions window is shared between all browser windows. | 74 // Passwords and exceptions window is shared between all browser windows. |
| 74 NULL, | 75 NULL, |
| 75 // Non-modal. | 76 // Non-modal. |
| 76 GTK_DIALOG_NO_SEPARATOR, | 77 GTK_DIALOG_NO_SEPARATOR, |
| 77 GTK_STOCK_CLOSE, | 78 GTK_STOCK_CLOSE, |
| 78 GTK_RESPONSE_CLOSE, | 79 GTK_RESPONSE_CLOSE, |
| 79 NULL); | 80 NULL); |
| 80 gtk_window_set_default_size(GTK_WINDOW(dialog_), | 81 gtk_window_set_default_size(GTK_WINDOW(dialog_), |
| 81 kPasswordsExceptionsWindowInitialWidth, -1); | 82 kPasswordsExceptionsWindowInitialWidth, |
| 83 kPasswordsExceptionsWindowInitialHeight); |
| 82 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), | 84 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox), |
| 83 gtk_util::kContentAreaSpacing); | 85 gtk_util::kContentAreaSpacing); |
| 84 gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); | 86 gtk_util::SetWindowIcon(GTK_WINDOW(dialog_)); |
| 85 | 87 |
| 86 notebook_ = gtk_notebook_new(); | 88 notebook_ = gtk_notebook_new(); |
| 87 | 89 |
| 88 gtk_notebook_append_page( | 90 gtk_notebook_append_page( |
| 89 GTK_NOTEBOOK(notebook_), | 91 GTK_NOTEBOOK(notebook_), |
| 90 passwords_page_.get_page_widget(), | 92 passwords_page_.get_page_widget(), |
| 91 gtk_label_new(l10n_util::GetStringUTF8( | 93 gtk_label_new(l10n_util::GetStringUTF8( |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // Factory/finder method: | 133 // Factory/finder method: |
| 132 | 134 |
| 133 void ShowPasswordsExceptionsWindow(Profile* profile) { | 135 void ShowPasswordsExceptionsWindow(Profile* profile) { |
| 134 DCHECK(profile); | 136 DCHECK(profile); |
| 135 // If there's already an existing passwords and exceptions window, use it. | 137 // If there's already an existing passwords and exceptions window, use it. |
| 136 if (!passwords_exceptions_window) { | 138 if (!passwords_exceptions_window) { |
| 137 passwords_exceptions_window = new PasswordsExceptionsWindowGtk(profile); | 139 passwords_exceptions_window = new PasswordsExceptionsWindowGtk(profile); |
| 138 } | 140 } |
| 139 passwords_exceptions_window->Show(); | 141 passwords_exceptions_window->Show(); |
| 140 } | 142 } |
| OLD | NEW |