summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/options
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/options')
-rw-r--r--chrome/browser/gtk/options/content_exception_editor.cc2
-rw-r--r--chrome/browser/gtk/options/content_exceptions_window_gtk.cc7
-rw-r--r--chrome/browser/gtk/options/content_settings_window_gtk.cc5
-rw-r--r--chrome/browser/gtk/options/cookies_view.cc10
-rw-r--r--chrome/browser/gtk/options/fonts_languages_window_gtk.cc4
-rw-r--r--chrome/browser/gtk/options/geolocation_content_exceptions_window.cc11
-rw-r--r--chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc13
-rw-r--r--chrome/browser/gtk/options/url_picker_dialog_gtk.cc5
8 files changed, 37 insertions, 20 deletions
diff --git a/chrome/browser/gtk/options/content_exception_editor.cc b/chrome/browser/gtk/options/content_exception_editor.cc
index 264282f..ea12db9 100644
--- a/chrome/browser/gtk/options/content_exception_editor.cc
+++ b/chrome/browser/gtk/options/content_exception_editor.cc
@@ -72,7 +72,7 @@ ContentExceptionEditor::ContentExceptionEditor(
// Prime the state of the buttons.
OnEntryChanged(entry_);
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialog(dialog_);
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);
diff --git a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
index e1e3e8b..04929c5 100644
--- a/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_exceptions_window_gtk.cc
@@ -35,6 +35,8 @@ void ContentExceptionsWindowGtk::ShowExceptionsWindow(
if (!instances[type]) {
// Create the options window.
instances[type] = new ContentExceptionsWindowGtk(parent, map, type);
+ } else {
+ gtk_util::PresentWindow(instances[type]->dialog_, 0);
}
}
@@ -142,7 +144,10 @@ ContentExceptionsWindowGtk::ContentExceptionsWindowGtk(
UpdateButtonState();
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_,
+ IDS_CONTENT_EXCEPTION_DIALOG_WIDTH_CHARS,
+ -1,
+ true);
g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL);
g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);
diff --git a/chrome/browser/gtk/options/content_settings_window_gtk.cc b/chrome/browser/gtk/options/content_settings_window_gtk.cc
index 3ad2a15..a9421d4 100644
--- a/chrome/browser/gtk/options/content_settings_window_gtk.cc
+++ b/chrome/browser/gtk/options/content_settings_window_gtk.cc
@@ -129,7 +129,7 @@ ContentSettingsWindowGtk::ContentSettingsWindowGtk(GtkWindow* parent,
// Need to show the notebook before connecting switch-page signal, otherwise
// we'll immediately get a signal switching to page 0 and overwrite our
// last_selected_page_ value.
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_, -1, -1, true);
g_signal_connect(notebook_, "switch-page",
G_CALLBACK(OnSwitchPageThunk), this);
@@ -148,8 +148,7 @@ void ContentSettingsWindowGtk::ShowContentSettingsTab(
ContentSettingsType page) {
// Bring options window to front if it already existed and isn't already
// in front
- gtk_window_present_with_time(GTK_WINDOW(dialog_),
- gtk_get_current_event_time());
+ gtk_util::PresentWindow(dialog_, gtk_get_current_event_time());
if (page == CONTENT_SETTINGS_TYPE_DEFAULT) {
// Remember the last visited page from local state.
diff --git a/chrome/browser/gtk/options/cookies_view.cc b/chrome/browser/gtk/options/cookies_view.cc
index 1d67b5a..155e775 100644
--- a/chrome/browser/gtk/options/cookies_view.cc
+++ b/chrome/browser/gtk/options/cookies_view.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/gtk/gtk_util.h"
#include "gfx/gtk_util.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
namespace {
@@ -55,7 +56,7 @@ void CookiesView::Show(
// If there's already an existing editor window, activate it.
if (instance_) {
- gtk_window_present(GTK_WINDOW(instance_->dialog_));
+ gtk_util::PresentWindow(instance_->dialog_, 0);
} else {
instance_ = new CookiesView(parent,
profile,
@@ -78,7 +79,12 @@ CookiesView::CookiesView(
filter_update_factory_(this),
destroy_dialog_in_destructor_(false) {
Init(parent);
- gtk_widget_show_all(dialog_);
+
+ gtk_util::ShowDialogWithLocalizedSize(dialog_,
+ IDS_COOKIES_DIALOG_WIDTH_CHARS,
+ -1,
+ true);
+
gtk_chrome_cookie_view_clear(GTK_CHROME_COOKIE_VIEW(cookie_display_));
}
diff --git a/chrome/browser/gtk/options/fonts_languages_window_gtk.cc b/chrome/browser/gtk/options/fonts_languages_window_gtk.cc
index 3b3b750..d51c10e 100644
--- a/chrome/browser/gtk/options/fonts_languages_window_gtk.cc
+++ b/chrome/browser/gtk/options/fonts_languages_window_gtk.cc
@@ -97,7 +97,7 @@ FontsLanguagesWindowGtk::FontsLanguagesWindowGtk(Profile* profile)
IDS_FONT_LANGUAGE_SETTING_LANGUAGES_TAB_TITLE).c_str()));
// Show the notebook.
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_, -1, -1, false);
// We only have one button and don't do any special handling, so just hook it
// directly to gtk_widget_destroy.
@@ -117,7 +117,7 @@ void FontsLanguagesWindowGtk::ShowTabPage(gfx::NativeWindow window,
// Bring options window to front if it already existed and isn't already
// in front.
- gtk_window_present(GTK_WINDOW(dialog_));
+ gtk_util::PresentWindow(dialog_, 0);
// If the page is out of bounds, reset to the first tab.
if (page < 0 || page >= gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook_)))
diff --git a/chrome/browser/gtk/options/geolocation_content_exceptions_window.cc b/chrome/browser/gtk/options/geolocation_content_exceptions_window.cc
index 0274faf..84c4b57 100644
--- a/chrome/browser/gtk/options/geolocation_content_exceptions_window.cc
+++ b/chrome/browser/gtk/options/geolocation_content_exceptions_window.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/gtk/gtk_util.h"
#include "gfx/gtk_util.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
namespace {
@@ -24,8 +25,11 @@ void GeolocationContentExceptionsWindow::ShowExceptionsWindow(
GtkWindow* parent, GeolocationContentSettingsMap* map) {
DCHECK(map);
- if (!instance)
+ if (!instance) {
instance = new GeolocationContentExceptionsWindow(parent, map);
+ } else {
+ gtk_util::PresentWindow(instance->dialog_, 0);
+ }
}
GeolocationContentExceptionsWindow::GeolocationContentExceptionsWindow(
@@ -111,7 +115,10 @@ GeolocationContentExceptionsWindow::GeolocationContentExceptionsWindow(
UpdateButtonState();
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_,
+ IDS_GEOLOCATION_EXCEPTION_DIALOG_WIDTH_CHARS,
+ IDS_GEOLOCATION_EXCEPTION_DIALOG_HEIGHT_LINES,
+ true);
g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL);
g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);
diff --git a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
index 1abcf72..33fa5b3 100644
--- a/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
+++ b/chrome/browser/gtk/options/passwords_exceptions_window_gtk.cc
@@ -102,19 +102,16 @@ PasswordsExceptionsWindowGtk::PasswordsExceptionsWindowGtk(Profile* profile)
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog_)->vbox), notebook_);
- gtk_widget_realize(dialog_);
- gtk_util::SetWindowSizeFromResources(GTK_WINDOW(dialog_),
- IDS_PASSWORDS_DIALOG_WIDTH_CHARS,
- IDS_PASSWORDS_DIALOG_HEIGHT_LINES,
- true);
-
// We only have one button and don't do any special handling, so just hook it
// directly to gtk_widget_destroy.
g_signal_connect(dialog_, "response", G_CALLBACK(gtk_widget_destroy), NULL);
g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroy), this);
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_,
+ IDS_PASSWORDS_DIALOG_WIDTH_CHARS,
+ IDS_PASSWORDS_DIALOG_HEIGHT_LINES,
+ true);
}
PasswordsExceptionsWindowGtk::~PasswordsExceptionsWindowGtk() {
@@ -123,7 +120,7 @@ PasswordsExceptionsWindowGtk::~PasswordsExceptionsWindowGtk() {
void PasswordsExceptionsWindowGtk::Show() {
// Bring options window to front if it already existed and isn't already
// in front
- gtk_window_present(GTK_WINDOW(dialog_));
+ gtk_util::PresentWindow(dialog_, 0);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc
index b5e5a5b..11a50ea 100644
--- a/chrome/browser/gtk/options/url_picker_dialog_gtk.cc
+++ b/chrome/browser/gtk/options/url_picker_dialog_gtk.cc
@@ -166,7 +166,10 @@ UrlPickerDialogGtk::UrlPickerDialogGtk(UrlPickerCallback* callback,
&width, NULL);
gtk_tree_view_column_set_fixed_width(column, width);
- gtk_widget_show_all(dialog_);
+ gtk_util::ShowDialogWithLocalizedSize(dialog_,
+ IDS_URLPICKER_DIALOG_WIDTH_CHARS,
+ IDS_URLPICKER_DIALOG_HEIGHT_LINES,
+ false);
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
g_signal_connect(dialog_, "destroy", G_CALLBACK(OnWindowDestroyThunk), this);