OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 g_signal_connect_after(wrench_box, "expose-event", | 227 g_signal_connect_after(wrench_box, "expose-event", |
228 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); | 228 G_CALLBACK(OnWrenchMenuButtonExposeThunk), this); |
229 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); | 229 gtk_container_add(GTK_CONTAINER(wrench_box), wrench_button); |
230 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); | 230 gtk_box_pack_start(GTK_BOX(toolbar_), wrench_box, FALSE, FALSE, 4); |
231 | 231 |
232 wrench_menu_.reset(new MenuGtk(this, wrench_menu_model_.get())); | 232 wrench_menu_.reset(new MenuGtk(this, wrench_menu_model_.get())); |
233 // The bookmark menu model needs to be able to force the wrench menu to close. | 233 // The bookmark menu model needs to be able to force the wrench menu to close. |
234 wrench_menu_model_->bookmark_sub_menu_model()->SetMenuGtk(wrench_menu_.get()); | 234 wrench_menu_model_->bookmark_sub_menu_model()->SetMenuGtk(wrench_menu_.get()); |
235 | 235 |
236 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 236 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
237 content::Source<HostZoomMap>(profile->GetHostZoomMap())); | 237 content::Source<HostZoomMap>( |
| 238 HostZoomMap::GetForBrowserContext(profile)); |
238 | 239 |
239 if (ShouldOnlyShowLocation()) { | 240 if (ShouldOnlyShowLocation()) { |
240 gtk_widget_show(event_box_); | 241 gtk_widget_show(event_box_); |
241 gtk_widget_show(alignment_); | 242 gtk_widget_show(alignment_); |
242 gtk_widget_show(toolbar_); | 243 gtk_widget_show(toolbar_); |
243 gtk_widget_show_all(location_hbox_); | 244 gtk_widget_show_all(location_hbox_); |
244 gtk_widget_hide(reload_->widget()); | 245 gtk_widget_hide(reload_->widget()); |
245 } else { | 246 } else { |
246 gtk_widget_show_all(event_box_); | 247 gtk_widget_show_all(event_box_); |
247 if (actions_toolbar_->button_count() == 0) | 248 if (actions_toolbar_->button_count() == 0) |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 const SkBitmap* badge = theme_service_->GetBitmapNamed(resource_id); | 682 const SkBitmap* badge = theme_service_->GetBitmapNamed(resource_id); |
682 gfx::CanvasSkiaPaint canvas(expose, false); | 683 gfx::CanvasSkiaPaint canvas(expose, false); |
683 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width(); | 684 int x_offset = base::i18n::IsRTL() ? 0 : allocation.width - badge->width(); |
684 int y_offset = 0; | 685 int y_offset = 0; |
685 canvas.DrawBitmapInt(*badge, | 686 canvas.DrawBitmapInt(*badge, |
686 allocation.x + x_offset, | 687 allocation.x + x_offset, |
687 allocation.y + y_offset); | 688 allocation.y + y_offset); |
688 | 689 |
689 return FALSE; | 690 return FALSE; |
690 } | 691 } |
OLD | NEW |