OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/browser_toolbar_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_toolbar_gtk.h" |
6 | 6 |
7 #include <X11/XF86keysym.h> | 7 #include <X11/XF86keysym.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 // Put the wrench button in a box so that we can paint the update notification | 217 // Put the wrench button in a box so that we can paint the update notification |
218 // over it. | 218 // over it. |
219 GtkWidget* wrench_box = gtk_alignment_new(0, 0, 1, 1); | 219 GtkWidget* wrench_box = gtk_alignment_new(0, 0, 1, 1); |
220 g_signal_connect_after(wrench_box, "expose-event", | 220 g_signal_connect_after(wrench_box, "expose-event", |
221 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); | 221 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); |
222 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); | 222 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); |
223 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); | 223 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); |
224 | 224 |
225 wrench_menu_.reset(new MenuGtk(this, wrench_menu_model_.get())); | 225 wrench_menu_.reset(new MenuGtk(this, wrench_menu_model_.get())); |
| 226 // The bookmark menu model needs to be able to force the wrench menu to close. |
| 227 wrench_menu_model_->bookmark_sub_menu_model()->SetMenuGtk(wrench_menu_.get()); |
| 228 |
226 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 229 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
227 Source<HostZoomMap>(profile->GetHostZoomMap())); | 230 Source<HostZoomMap>(profile->GetHostZoomMap())); |
228 | 231 |
229 if (ShouldOnlyShowLocation()) { | 232 if (ShouldOnlyShowLocation()) { |
230 gtk_widget_show(event_box_); | 233 gtk_widget_show(event_box_); |
231 gtk_widget_show(alignment_); | 234 gtk_widget_show(alignment_); |
232 gtk_widget_show(toolbar_); | 235 gtk_widget_show(toolbar_); |
233 gtk_widget_show_all(location_hbox_); | 236 gtk_widget_show_all(location_hbox_); |
234 gtk_widget_hide(reload_->widget()); | 237 gtk_widget_hide(reload_->widget()); |
235 } else { | 238 } else { |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 int x_offset = base::i18n::IsRTL() ? 0 : | 663 int x_offset = base::i18n::IsRTL() ? 0 : |
661 sender->allocation.width - badge->width(); | 664 sender->allocation.width - badge->width(); |
662 int y_offset = 0; | 665 int y_offset = 0; |
663 canvas.DrawBitmapInt( | 666 canvas.DrawBitmapInt( |
664 *badge, | 667 *badge, |
665 sender->allocation.x + x_offset, | 668 sender->allocation.x + x_offset, |
666 sender->allocation.y + y_offset); | 669 sender->allocation.y + y_offset); |
667 | 670 |
668 return FALSE; | 671 return FALSE; |
669 } | 672 } |
OLD | NEW |