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

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

Issue 6257006: Move a bunch of random other files to src/ui/base... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « chrome/browser/ui/gtk/menu_bar_helper.h ('k') | chrome/browser/ui/gtk/menu_gtk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/menu_bar_helper.h" 5 #include "chrome/browser/ui/gtk/menu_bar_helper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/gtk_signal_registrar.h"
10 #include "base/logging.h" 9 #include "base/logging.h"
11 #include "chrome/browser/ui/gtk/gtk_util.h" 10 #include "chrome/browser/ui/gtk/gtk_util.h"
11 #include "ui/base/gtk/gtk_signal_registrar.h"
12 12
13 namespace { 13 namespace {
14 14
15 // Recursively find all the GtkMenus that are attached to menu item |child| 15 // Recursively find all the GtkMenus that are attached to menu item |child|
16 // and add them to |data|, which is a vector of GtkWidgets. 16 // and add them to |data|, which is a vector of GtkWidgets.
17 void PopulateSubmenus(GtkWidget* child, gpointer data) { 17 void PopulateSubmenus(GtkWidget* child, gpointer data) {
18 std::vector<GtkWidget*>* submenus = 18 std::vector<GtkWidget*>* submenus =
19 static_cast<std::vector<GtkWidget*>*>(data); 19 static_cast<std::vector<GtkWidget*>*>(data);
20 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(child)); 20 GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(child));
21 if (submenu) { 21 if (submenu) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 void MenuBarHelper::Clear() { 75 void MenuBarHelper::Clear() {
76 buttons_.clear(); 76 buttons_.clear();
77 } 77 }
78 78
79 void MenuBarHelper::MenuStartedShowing(GtkWidget* button, GtkWidget* menu) { 79 void MenuBarHelper::MenuStartedShowing(GtkWidget* button, GtkWidget* menu) {
80 DCHECK(GTK_IS_MENU(menu)); 80 DCHECK(GTK_IS_MENU(menu));
81 button_showing_menu_ = button; 81 button_showing_menu_ = button;
82 showing_menu_ = menu; 82 showing_menu_ = menu;
83 83
84 signal_handlers_.reset(new GtkSignalRegistrar()); 84 signal_handlers_.reset(new ui::GtkSignalRegistrar());
85 signal_handlers_->Connect(menu, "destroy", 85 signal_handlers_->Connect(menu, "destroy",
86 G_CALLBACK(OnMenuHiddenOrDestroyedThunk), this); 86 G_CALLBACK(OnMenuHiddenOrDestroyedThunk), this);
87 signal_handlers_->Connect(menu, "hide", 87 signal_handlers_->Connect(menu, "hide",
88 G_CALLBACK(OnMenuHiddenOrDestroyedThunk), this); 88 G_CALLBACK(OnMenuHiddenOrDestroyedThunk), this);
89 signal_handlers_->Connect(menu, "motion-notify-event", 89 signal_handlers_->Connect(menu, "motion-notify-event",
90 G_CALLBACK(OnMenuMotionNotifyThunk), this); 90 G_CALLBACK(OnMenuMotionNotifyThunk), this);
91 signal_handlers_->Connect(menu, "move-current", 91 signal_handlers_->Connect(menu, "move-current",
92 G_CALLBACK(OnMenuMoveCurrentThunk), this); 92 G_CALLBACK(OnMenuMoveCurrentThunk), this);
93 gtk_container_foreach(GTK_CONTAINER(menu), PopulateSubmenus, &submenus_); 93 gtk_container_foreach(GTK_CONTAINER(menu), PopulateSubmenus, &submenus_);
94 94
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 break; 174 break;
175 } 175 }
176 default: 176 default:
177 return; 177 return;
178 } 178 }
179 179
180 // This signal doesn't have a return value; we have to manually stop its 180 // This signal doesn't have a return value; we have to manually stop its
181 // propagation. 181 // propagation.
182 g_signal_stop_emission_by_name(menu, "move-current"); 182 g_signal_stop_emission_by_name(menu, "move-current");
183 } 183 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/menu_bar_helper.h ('k') | chrome/browser/ui/gtk/menu_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698