Chromium Code Reviews| 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/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 "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 { IDS_CLOSE_TAB_LINUX, IDC_CLOSE_TAB }, | 49 { IDS_CLOSE_TAB_LINUX, IDC_CLOSE_TAB }, |
| 50 { IDS_SAVE_PAGE, IDC_SAVE_PAGE }, | 50 { IDS_SAVE_PAGE, IDC_SAVE_PAGE }, |
| 51 | 51 |
| 52 { MENU_SEPARATOR, MENU_SEPARATOR }, | 52 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 53 | 53 |
| 54 { IDS_PRINT, IDC_PRINT }, | 54 { IDS_PRINT, IDC_PRINT }, |
| 55 | 55 |
| 56 { MENU_END, MENU_END } | 56 { MENU_END, MENU_END } |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // TODO(erg): Need to add support for undo/redo/other editing commands that | |
| 60 // don't go through the command id framework. | |
| 61 GlobalMenuBarCommand edit_menu[] = { | 59 GlobalMenuBarCommand edit_menu[] = { |
| 62 // TODO(erg): Undo | |
| 63 // TODO(erg): Redo | |
|
Elliot Glaysher
2011/05/12 23:21:18
I have no idea how to actually hook these up. Remo
| |
| 64 | |
| 65 // TODO(erg): Separator | |
| 66 | |
| 67 { IDS_CUT, IDC_CUT }, | 60 { IDS_CUT, IDC_CUT }, |
| 68 { IDS_COPY, IDC_COPY }, | 61 { IDS_COPY, IDC_COPY }, |
| 69 { IDS_PASTE, IDC_PASTE }, | 62 { IDS_PASTE, IDC_PASTE }, |
| 70 // TODO(erg): Delete | |
| 71 | 63 |
| 72 { MENU_SEPARATOR, MENU_SEPARATOR }, | 64 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 73 | 65 |
| 74 // TODO(erg): Select All | |
| 75 // TODO(erg): Another separator | |
| 76 | |
| 77 { IDS_FIND, IDC_FIND }, | 66 { IDS_FIND, IDC_FIND }, |
| 78 | 67 |
| 79 { MENU_SEPARATOR, MENU_SEPARATOR }, | 68 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 80 | 69 |
| 81 { IDS_PREFERENCES, IDC_OPTIONS }, | 70 { IDS_PREFERENCES, IDC_OPTIONS }, |
| 82 | 71 |
| 83 { MENU_END, MENU_END } | 72 { MENU_END, MENU_END } |
| 84 }; | 73 }; |
| 85 | 74 |
| 86 // TODO(erg): The View menu should be overhauled and based on the Firefox view | |
| 87 // menu. | |
| 88 GlobalMenuBarCommand view_menu[] = { | 75 GlobalMenuBarCommand view_menu[] = { |
| 89 { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR }, | 76 { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR }, |
| 90 | 77 |
| 91 { MENU_SEPARATOR, MENU_SEPARATOR }, | 78 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 92 | 79 |
| 93 { IDS_STOP_MENU_LINUX, IDC_STOP }, | 80 { IDS_STOP_MENU_LINUX, IDC_STOP }, |
| 94 { IDS_RELOAD_MENU_LINUX, IDC_RELOAD }, | 81 { IDS_RELOAD_MENU_LINUX, IDC_RELOAD }, |
| 95 | 82 |
| 96 { MENU_SEPARATOR, MENU_SEPARATOR }, | 83 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 97 | 84 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 } | 299 } |
| 313 } | 300 } |
| 314 | 301 |
| 315 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { | 302 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { |
| 316 if (block_activation_) | 303 if (block_activation_) |
| 317 return; | 304 return; |
| 318 | 305 |
| 319 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); | 306 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); |
| 320 browser_->ExecuteCommandIfEnabled(id); | 307 browser_->ExecuteCommandIfEnabled(id); |
| 321 } | 308 } |
| OLD | NEW |