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

Side by Side Diff: chrome/browser/gtk/standard_menus.cc

Issue 20245: Port the Menu class to GTK. (Closed)
Patch Set: Fixes for evanm Created 11 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/gtk/standard_menus.h"
6
7 #include "base/basictypes.h"
8 #include "chrome/app/chrome_dll_resource.h"
9 #include "chrome/common/l10n_util.h"
10
11 #include "chromium_strings.h"
12 #include "generated_resources.h"
13
14 namespace {
15
16 struct MenuCreateMaterial zoom_menu_materials[] = {
17 { MENU_NORMAL, IDC_ZOOM_PLUS, IDS_ZOOM_MENU, 0, NULL },
18 { MENU_NORMAL, IDC_ZOOM_PLUS, IDS_ZOOM_PLUS, 0, NULL },
19 { MENU_NORMAL, IDC_ZOOM_NORMAL, IDS_ZOOM_NORMAL, 0, NULL },
20 { MENU_NORMAL, IDC_ZOOM_MINUS, IDS_ZOOM_MINUS, 0, NULL },
21 { MENU_END, 0, 0, NULL }
22 };
23
24 struct MenuCreateMaterial encoding_menu_materials[] = {
25 { MENU_CHECKBOX, IDC_ENCODING_AUTO_DETECT, IDS_ENCODING_AUTO_DETECT, 0,
26 NULL },
27 { MENU_END, 0, 0, NULL }
28 };
29
30 struct MenuCreateMaterial developer_menu_materials[] = {
31 { MENU_NORMAL, IDC_VIEW_SOURCE, IDS_VIEW_SOURCE, 0, NULL },
32 { MENU_NORMAL, IDC_DEBUGGER, IDS_DEBUGGER, 0, NULL },
33 { MENU_NORMAL, IDC_JS_CONSOLE, IDS_JS_CONSOLE, 0, NULL },
34 { MENU_NORMAL, IDC_TASK_MANAGER, IDS_TASK_MANAGER, 0, NULL },
35 { MENU_END, 0, 0, NULL }
36 };
37
38 struct MenuCreateMaterial standard_page_menu_materials[] = {
39 { MENU_NORMAL, IDC_CREATE_SHORTCUTS, IDS_CREATE_SHORTCUTS, 0, NULL },
40 { MENU_SEPARATOR, 0, 0, 0, NULL },
41 { MENU_NORMAL, IDC_CUT, IDS_CUT, 0, NULL },
42 { MENU_NORMAL, IDC_COPY, IDS_COPY, 0, NULL },
43 { MENU_NORMAL, IDC_PASTE, IDS_PASTE, 0, NULL },
44 { MENU_SEPARATOR, 0, 0, 0, NULL },
45 { MENU_NORMAL, IDC_FIND, IDS_FIND, 0, NULL },
46 { MENU_NORMAL, IDC_SAVE_PAGE, IDS_SAVE_PAGE, 0, NULL },
47 { MENU_NORMAL, IDC_PRINT, IDS_PRINT, 0, NULL },
48 { MENU_SEPARATOR, 0, 0, 0, NULL },
49 { MENU_NORMAL, IDC_ZOOM_MENU, IDS_ZOOM_MENU, 0, zoom_menu_materials },
50 { MENU_NORMAL, IDC_ENCODING_MENU, IDS_ENCODING_MENU, 0,
51 encoding_menu_materials },
52 { MENU_SEPARATOR, 0, 0, 0, NULL },
53 { MENU_NORMAL, IDC_DEVELOPER_MENU, IDS_DEVELOPER_MENU, 0,
54 developer_menu_materials },
55 { MENU_SEPARATOR, 0, 0, 0, NULL },
56 { MENU_NORMAL, IDC_REPORT_BUG, IDS_REPORT_BUG, 0, NULL },
57 { MENU_END, 0, 0, NULL }
58 };
59
60 // -----------------------------------------------------------------------
61
62 struct MenuCreateMaterial standard_app_menu_materials[] = {
63 { MENU_NORMAL, IDC_NEW_TAB, IDS_NEW_TAB, 0, NULL },
64 { MENU_NORMAL, IDC_NEW_WINDOW, IDS_NEW_WINDOW, 0, NULL },
65 { MENU_NORMAL, IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW, 0, NULL },
66 { MENU_NORMAL, IDC_PROFILE_MENU, IDS_PROFILE_MENU, 0, NULL },
67 { MENU_SEPARATOR, 0, 0, NULL },
68 { MENU_NORMAL, IDC_SHOW_BOOKMARK_BAR, IDS_SHOW_BOOKMARK_BAR },
69 { MENU_SEPARATOR, 0, 0, NULL },
70 { MENU_NORMAL, IDC_SHOW_HISTORY, IDS_SHOW_HISTORY },
71 { MENU_NORMAL, IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER },
72 { MENU_NORMAL, IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS },
73 { MENU_SEPARATOR, 0, 0, NULL },
74 // TODO(erg): P13N stuff goes here as soon as they get IDS strings.
75 { MENU_NORMAL, IDC_CLEAR_BROWSING_DATA, IDS_CLEAR_BROWSING_DATA, 0, NULL },
76 { MENU_NORMAL, IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS, 0, NULL },
77 { MENU_SEPARATOR, 0, 0, 0, NULL },
78 { MENU_NORMAL, IDC_OPTIONS, IDS_OPTIONS, IDS_PRODUCT_NAME, NULL },
79 { MENU_NORMAL, IDC_ABOUT, IDS_ABOUT, IDS_PRODUCT_NAME, NULL },
80 { MENU_NORMAL, IDC_HELP_PAGE, IDS_HELP_PAGE, 0, NULL },
81 { MENU_SEPARATOR, 0, 0, 0, NULL },
82 { MENU_NORMAL, IDC_EXIT, IDS_EXIT, 0, NULL },
83 { MENU_END, 0, 0, NULL }
84 };
85
86 } // namespace
87
88 const MenuCreateMaterial* GetStandardPageMenu() {
89 return standard_page_menu_materials;
90 }
91
92 const MenuCreateMaterial* GetStandardAppMenu() {
93 return standard_app_menu_materials;
94 }
OLDNEW
« chrome/browser/gtk/menu_gtk.cc ('K') | « chrome/browser/gtk/standard_menus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698