summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 01:20:46 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-06 01:20:46 +0000
commit952a078a76e9f8c22cc43d5ce47c5c83e2f8e772 (patch)
treef7d08993904a9024ccec1802a3b18b5201583ade
parent8ddbaac46292230ca3d8b5647e94d1a5bd4859ae (diff)
downloadchromium_src-952a078a76e9f8c22cc43d5ce47c5c83e2f8e772.zip
chromium_src-952a078a76e9f8c22cc43d5ce47c5c83e2f8e772.tar.gz
chromium_src-952a078a76e9f8c22cc43d5ce47c5c83e2f8e772.tar.bz2
[gtk] Fix a couple painting issues with infobar arrows.
1) repaint the arrow when the location icon moves. The location icon can move, for example, when the home button is added or removed. 2) paint the arrow on top of the location icon explicitly. This is necessary because sometimes the location icon sits in a different X window from the toolbar, and we cannot paint over it in the toolbar's expose event. In particular, try going to paypal.com and then crashing flash. Without this patch, the top of the arrow will be lopped off. BUG=68457 TEST=manual Review URL: http://codereview.chromium.org/6056010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70574 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc13
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 0728464..ec300a1 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1560,6 +1560,13 @@ void BrowserWindowGtk::InitWidgets() {
gtk_container_add(GTK_CONTAINER(render_area_floating_container_),
render_area_vbox_);
+ GtkWidget* location_icon = toolbar_->GetLocationBarView()->
+ location_icon_widget();
+ g_signal_connect(location_icon, "size-allocate",
+ G_CALLBACK(OnLocationIconSizeAllocateThunk), this);
+ g_signal_connect_after(location_icon, "expose-event",
+ G_CALLBACK(OnExposeDrawInfobarBitsThunk), this);
+
toolbar_border_ = gtk_event_box_new();
gtk_box_pack_start(GTK_BOX(render_area_vbox_),
toolbar_border_, FALSE, FALSE, 0);
@@ -1805,6 +1812,12 @@ int BrowserWindowGtk::GetXPositionOfLocationIcon(GtkWidget* relative_to) {
return x;
}
+void BrowserWindowGtk::OnLocationIconSizeAllocate(GtkWidget* sender,
+ GtkAllocation* allocation) {
+ // The position of the arrow may have changed, so we'll have to redraw it.
+ InvalidateInfoBarBits();
+}
+
gboolean BrowserWindowGtk::OnExposeDrawInfobarBits(GtkWidget* sender,
GdkEventExpose* expose) {
if (!infobar_arrow_model_.NeedToDrawInfoBarArrow())
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h
index 069cfd5..ad2fa40 100644
--- a/chrome/browser/gtk/browser_window_gtk.h
+++ b/chrome/browser/gtk/browser_window_gtk.h
@@ -314,6 +314,10 @@ class BrowserWindowGtk : public BrowserWindow,
// has changed.
void InvalidateInfoBarBits();
+ // When the location icon moves, we have to redraw the arrow.
+ CHROMEGTK_CALLBACK_1(BrowserWindowGtk, void, OnLocationIconSizeAllocate,
+ GtkAllocation*);
+
// Used to draw the infobar arrow and drop shadow. This is connected to
// multiple widgets' expose events because it overlaps several widgets.
CHROMEGTK_CALLBACK_1(BrowserWindowGtk, gboolean, OnExposeDrawInfobarBits,