summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 19:44:01 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-06 19:44:01 +0000
commit0233bf2a7059f6f24db9705be5ac61128a4b86c0 (patch)
tree57fa35a3cda2d637ba675a76ca6c76c6660d67e0
parent8368f194019805e5cca637e2b94d78ac9724d29d (diff)
downloadchromium_src-0233bf2a7059f6f24db9705be5ac61128a4b86c0.zip
chromium_src-0233bf2a7059f6f24db9705be5ac61128a4b86c0.tar.gz
chromium_src-0233bf2a7059f6f24db9705be5ac61128a4b86c0.tar.bz2
GTK: More raw struct access removal, this time focusing on GtkDialog.
BUG=79722 TEST=compiles Review URL: http://codereview.chromium.org/9113033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116717 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc9
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/certificate_viewer.cc7
-rw-r--r--chrome/browser/ui/gtk/edit_search_engine_dialog.cc12
-rw-r--r--chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc6
-rw-r--r--chrome/browser/ui/gtk/html_dialog_gtk.cc5
-rw-r--r--chrome/browser/ui/gtk/infobars/infobar_gtk.cc7
-rw-r--r--chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc6
-rw-r--r--chrome/browser/ui/gtk/task_manager_gtk.cc10
-rw-r--r--chrome/browser/ui/gtk/update_recommended_dialog.cc7
10 files changed, 38 insertions, 33 deletions
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
index b431ed5..1f747b3 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc
@@ -434,13 +434,14 @@ void BookmarkBarGtk::Show(BookmarkBar::State old_state,
// probably be improved.
if (bookmark_bar_state_ == BookmarkBar::DETACHED) {
if (theme_service_->UsingNativeTheme()) {
- if (gtk_widget_get_realized(event_box_->parent))
- gdk_window_lower(event_box_->parent->window);
+ GtkWidget* parent = gtk_widget_get_parent(event_box_.get());
+ if (gtk_widget_get_realized(parent))
+ gdk_window_lower(gtk_widget_get_window(parent));
if (gtk_widget_get_realized(event_box_.get()))
- gdk_window_lower(event_box_->window);
+ gdk_window_lower(gtk_widget_get_window(event_box_.get()));
} else { // Chromium theme mode.
if (gtk_widget_get_realized(paint_box_)) {
- gdk_window_lower(paint_box_->window);
+ gdk_window_lower(gtk_widget_get_window(paint_box_));
// The event box won't stay below its children's GdkWindows unless we
// toggle the above-child property here. If the event box doesn't stay
// below its children then events will be routed to it rather than the
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc
index 8c0d73b..dbe835b 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_editor_gtk.cc
@@ -311,7 +311,7 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) {
#endif
if (show_tree_) {
- GtkWidget* action_area = GTK_DIALOG(dialog_)->action_area;
+ GtkWidget* action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog_));
new_folder_button_ = gtk_button_new_with_label(
l10n_util::GetStringUTF8(
IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON).c_str());
diff --git a/chrome/browser/ui/gtk/certificate_viewer.cc b/chrome/browser/ui/gtk/certificate_viewer.cc
index f1bb64d..a4279d5 100644
--- a/chrome/browser/ui/gtk/certificate_viewer.cc
+++ b/chrome/browser/ui/gtk/certificate_viewer.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -148,8 +148,9 @@ CertificateViewer::CertificateViewer(
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
NULL);
- gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox),
- ui::kContentAreaSpacing);
+
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing);
x509_certificate_model::RegisterDynamicOids();
InitGeneralPage();
diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc
index cba847f..0c086f9 100644
--- a/chrome/browser/ui/gtk/edit_search_engine_dialog.cc
+++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -179,8 +179,9 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) {
l10n_util::GetStringUTF8(IDS_SEARCH_ENGINES_EDITOR_URL_LABEL).c_str(),
gtk_util::CreateEntryImageHBox(url_entry_, url_image_),
NULL);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), controls,
- FALSE, FALSE, 0);
+
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_pack_start(GTK_BOX(content_area), controls, FALSE, FALSE, 0);
// On RTL UIs (such as Arabic and Hebrew) the description text is not
// displayed correctly since it contains the substring "%s". This substring
@@ -204,11 +205,10 @@ void EditSearchEngineDialog::Init(GtkWindow* parent_window, Profile* profile) {
}
GtkWidget* description_label = gtk_label_new(description.c_str());
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), description_label,
+ gtk_box_pack_start(GTK_BOX(content_area), description_label,
FALSE, FALSE, 0);
- gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox),
- ui::kContentAreaSpacing);
+ gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing);
EnableControls();
diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc
index ab178b5..b51c9f8 100644
--- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -96,8 +96,8 @@ ExternalProtocolDialogGtk::ExternalProtocolDialogGtk(const GURL& url)
FALSE, FALSE, 0);
// Add our vbox to the dialog.
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), vbox,
- FALSE, FALSE, 0);
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_pack_start(GTK_BOX(content_area), vbox, FALSE, FALSE, 0);
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
diff --git a/chrome/browser/ui/gtk/html_dialog_gtk.cc b/chrome/browser/ui/gtk/html_dialog_gtk.cc
index 6a03b92..da7a3a0 100644
--- a/chrome/browser/ui/gtk/html_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/html_dialog_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -203,7 +203,8 @@ gfx::NativeWindow HtmlDialogGtk::InitDialog() {
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
tab_contents_container_.reset(new TabContentsContainerGtk(NULL));
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox),
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_pack_start(GTK_BOX(content_area),
tab_contents_container_->widget(), TRUE, TRUE, 0);
tab_contents_container_->SetTab(tab_.get());
diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
index 5a66015..b8c84a4 100644
--- a/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
+++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -261,8 +261,9 @@ void InfoBarGtk::PlatformSpecificShow(bool animate) {
gtk_widget_show_all(widget_.get());
gtk_widget_set_size_request(widget_.get(), -1, bar_height());
- if (bg_box_->window)
- gdk_window_lower(bg_box_->window);
+ GdkWindow* gdk_window = gtk_widget_get_window(bg_box_);
+ if (gdk_window)
+ gdk_window_lower(gdk_window);
}
void InfoBarGtk::PlatformSpecificOnCloseSoon() {
diff --git a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc
index c16692d..5683582f 100644
--- a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -37,7 +37,7 @@ InstantConfirmDialogGtk::InstantConfirmDialogGtk(
NULL);
g_signal_connect(dialog_, "response", G_CALLBACK(OnResponseThunk), this);
- GtkBox* vbox = GTK_BOX(GTK_DIALOG(dialog_)->vbox);
+ GtkBox* vbox = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog_)));
gtk_box_set_spacing(vbox, ui::kControlSpacing);
GtkWidget* label = gtk_label_new(
@@ -50,7 +50,7 @@ InstantConfirmDialogGtk::InstantConfirmDialogGtk(
g_signal_connect(link_button, "clicked",
G_CALLBACK(OnLinkButtonClickedThunk), this);
- GtkWidget* action_area = GTK_DIALOG(dialog_)->action_area;
+ GtkWidget* action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog_));
gtk_container_add(GTK_CONTAINER(action_area), link_button);
gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(action_area),
link_button,
diff --git a/chrome/browser/ui/gtk/task_manager_gtk.cc b/chrome/browser/ui/gtk/task_manager_gtk.cc
index 55f5456..31fb42f 100644
--- a/chrome/browser/ui/gtk/task_manager_gtk.cc
+++ b/chrome/browser/ui/gtk/task_manager_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -499,13 +499,13 @@ void TaskManagerGtk::Init() {
// Setting the link widget to secondary positions the button on the left side
// of the action area (vice versa for RTL layout).
- gtk_button_box_set_child_secondary(
- GTK_BUTTON_BOX(GTK_DIALOG(dialog_)->action_area), link, TRUE);
+ GtkWidget* action_area = gtk_dialog_get_action_area(GTK_DIALOG(dialog_));
+ gtk_button_box_set_child_secondary(GTK_BUTTON_BOX(action_area), link, TRUE);
ConnectAccelerators();
- gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog_)->vbox),
- ui::kContentAreaSpacing);
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_set_spacing(GTK_BOX(content_area), ui::kContentAreaSpacing);
destroy_handler_id_ = g_signal_connect(dialog_, "destroy",
G_CALLBACK(OnDestroyThunk), this);
diff --git a/chrome/browser/ui/gtk/update_recommended_dialog.cc b/chrome/browser/ui/gtk/update_recommended_dialog.cc
index 7941a2e..dd0aecb 100644
--- a/chrome/browser/ui/gtk/update_recommended_dialog.cc
+++ b/chrome/browser/ui/gtk/update_recommended_dialog.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -39,8 +39,9 @@ UpdateRecommendedDialog::UpdateRecommendedDialog(GtkWindow* parent) {
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
GtkWidget* label = gtk_label_new(text.c_str());
gtk_util::SetLabelWidth(label, kMessageWidth);
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog_)->vbox), label,
- FALSE, FALSE, 0);
+
+ GtkWidget* content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog_));
+ gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
gtk_window_set_resizable(GTK_WINDOW(dialog_), FALSE);