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 // Put the wrench button in a box so that we can paint the update notification | 216 // Put the wrench button in a box so that we can paint the update notification |
217 // over it. | 217 // over it. |
218 GtkWidget* wrench_box = gtk_alignment_new(0, 0, 1, 1); | 218 GtkWidget* wrench_box = gtk_alignment_new(0, 0, 1, 1); |
219 g_signal_connect_after(wrench_box, "expose-event", | 219 g_signal_connect_after(wrench_box, "expose-event", |
220 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); | 220 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); |
221 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); | 221 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); |
222 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); | 222 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); |
223 | 223 |
224 wrench_menu_.reset(new MenuGtk(this, &wrench_menu_model_)); | 224 wrench_menu_.reset(new MenuGtk(this, &wrench_menu_model_)); |
225 registrar_.Add(this, NotificationType::ZOOM_LEVEL_CHANGED, | 225 registrar_.Add(this, NotificationType::ZOOM_LEVEL_CHANGED, |
226 Source<Profile>(browser_->profile())); | 226 Source<HostZoomMap>(browser_->profile()->GetHostZoomMap())); |
227 | 227 |
228 if (ShouldOnlyShowLocation()) { | 228 if (ShouldOnlyShowLocation()) { |
229 gtk_widget_show(event_box_); | 229 gtk_widget_show(event_box_); |
230 gtk_widget_show(alignment_); | 230 gtk_widget_show(alignment_); |
231 gtk_widget_show(toolbar_); | 231 gtk_widget_show(toolbar_); |
232 gtk_widget_show_all(location_hbox_); | 232 gtk_widget_show_all(location_hbox_); |
233 gtk_widget_hide(reload_->widget()); | 233 gtk_widget_hide(reload_->widget()); |
234 } else { | 234 } else { |
235 gtk_widget_show_all(event_box_); | 235 gtk_widget_show_all(event_box_); |
236 if (actions_toolbar_->button_count() == 0) | 236 if (actions_toolbar_->button_count() == 0) |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 int x_offset = base::i18n::IsRTL() ? 0 : | 649 int x_offset = base::i18n::IsRTL() ? 0 : |
650 sender->allocation.width - badge->width(); | 650 sender->allocation.width - badge->width(); |
651 int y_offset = 0; | 651 int y_offset = 0; |
652 canvas.DrawBitmapInt( | 652 canvas.DrawBitmapInt( |
653 *badge, | 653 *badge, |
654 sender->allocation.x + x_offset, | 654 sender->allocation.x + x_offset, |
655 sender->allocation.y + y_offset); | 655 sender->allocation.y + y_offset); |
656 | 656 |
657 return FALSE; | 657 return FALSE; |
658 } | 658 } |
OLD | NEW |