Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: chrome/browser/ui/gtk/browser_toolbar_gtk.cc

Issue 8286018: Reland r105450: Linux: add basic bookmark menu support. More features can be added later. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.cc ('k') | chrome/browser/ui/toolbar/bookmark_sub_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698