summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,