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/global_menu_bar.h" | 5 #include "chrome/browser/ui/gtk/global_menu_bar.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 { IDS_VIEW_SOURCE, IDC_VIEW_SOURCE }, | 131 { IDS_VIEW_SOURCE, IDC_VIEW_SOURCE }, |
132 { IDS_DEV_TOOLS, IDC_DEV_TOOLS }, | 132 { IDS_DEV_TOOLS, IDC_DEV_TOOLS }, |
133 { IDS_DEV_TOOLS_CONSOLE, IDC_DEV_TOOLS_CONSOLE }, | 133 { IDS_DEV_TOOLS_CONSOLE, IDC_DEV_TOOLS_CONSOLE }, |
134 | 134 |
135 { MENU_END, MENU_END } | 135 { MENU_END, MENU_END } |
136 }; | 136 }; |
137 | 137 |
138 GlobalMenuBarCommand help_menu[] = { | 138 GlobalMenuBarCommand help_menu[] = { |
139 { IDS_FEEDBACK, IDC_FEEDBACK }, | 139 { IDS_FEEDBACK, IDC_FEEDBACK }, |
140 { IDS_HELP_PAGE , IDC_HELP_PAGE }, | 140 { IDS_HELP_PAGE , IDC_HELP_PAGE_VIA_MENU }, |
141 { MENU_END, MENU_END } | 141 { MENU_END, MENU_END } |
142 }; | 142 }; |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 | 145 |
146 GlobalMenuBar::GlobalMenuBar(Browser* browser) | 146 GlobalMenuBar::GlobalMenuBar(Browser* browser) |
147 : browser_(browser), | 147 : browser_(browser), |
148 menu_bar_(gtk_menu_bar_new()), | 148 menu_bar_(gtk_menu_bar_new()), |
149 history_menu_(browser_), | 149 history_menu_(browser_), |
150 dummy_accel_group_(gtk_accel_group_new()), | 150 dummy_accel_group_(gtk_accel_group_new()), |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { | 306 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { |
307 if (block_activation_) | 307 if (block_activation_) |
308 return; | 308 return; |
309 | 309 |
310 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); | 310 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); |
311 browser_->ExecuteCommandIfEnabled(id); | 311 browser_->ExecuteCommandIfEnabled(id); |
312 } | 312 } |
OLD | NEW |