| 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. |
| 59 GlobalMenuBarCommand edit_menu[] = { | 61 GlobalMenuBarCommand edit_menu[] = { |
| 62 // TODO(erg): Undo |
| 63 // TODO(erg): Redo |
| 64 |
| 65 // TODO(erg): Separator |
| 66 |
| 60 { IDS_CUT, IDC_CUT }, | 67 { IDS_CUT, IDC_CUT }, |
| 61 { IDS_COPY, IDC_COPY }, | 68 { IDS_COPY, IDC_COPY }, |
| 62 { IDS_PASTE, IDC_PASTE }, | 69 { IDS_PASTE, IDC_PASTE }, |
| 70 // TODO(erg): Delete |
| 63 | 71 |
| 64 { MENU_SEPARATOR, MENU_SEPARATOR }, | 72 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 65 | 73 |
| 74 // TODO(erg): Select All |
| 75 // TODO(erg): Another separator |
| 76 |
| 66 { IDS_FIND, IDC_FIND }, | 77 { IDS_FIND, IDC_FIND }, |
| 67 | 78 |
| 68 { MENU_SEPARATOR, MENU_SEPARATOR }, | 79 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 69 | 80 |
| 70 { IDS_PREFERENCES, IDC_OPTIONS }, | 81 { IDS_PREFERENCES, IDC_OPTIONS }, |
| 71 | 82 |
| 72 { MENU_END, MENU_END } | 83 { MENU_END, MENU_END } |
| 73 }; | 84 }; |
| 74 | 85 |
| 86 // TODO(erg): The View menu should be overhauled and based on the Firefox view |
| 87 // menu. |
| 75 GlobalMenuBarCommand view_menu[] = { | 88 GlobalMenuBarCommand view_menu[] = { |
| 76 { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR }, | 89 { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR }, |
| 77 | 90 |
| 78 { MENU_SEPARATOR, MENU_SEPARATOR }, | 91 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 79 | 92 |
| 80 { IDS_STOP_MENU_LINUX, IDC_STOP }, | 93 { IDS_STOP_MENU_LINUX, IDC_STOP }, |
| 81 { IDS_RELOAD_MENU_LINUX, IDC_RELOAD }, | 94 { IDS_RELOAD_MENU_LINUX, IDC_RELOAD }, |
| 82 | 95 |
| 83 { MENU_SEPARATOR, MENU_SEPARATOR }, | 96 { MENU_SEPARATOR, MENU_SEPARATOR }, |
| 84 | 97 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 312 } |
| 300 } | 313 } |
| 301 | 314 |
| 302 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { | 315 void GlobalMenuBar::OnItemActivated(GtkWidget* sender) { |
| 303 if (block_activation_) | 316 if (block_activation_) |
| 304 return; | 317 return; |
| 305 | 318 |
| 306 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); | 319 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sender), "command-id")); |
| 307 browser_->ExecuteCommandIfEnabled(id); | 320 browser_->ExecuteCommandIfEnabled(id); |
| 308 } | 321 } |
| OLD | NEW |