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

Unified Diff: chrome/browser/gtk/standard_menus.cc

Issue 244029: GTK: Implement popup favicon menu. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/standard_menus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/standard_menus.cc
===================================================================
--- chrome/browser/gtk/standard_menus.cc (revision 27516)
+++ chrome/browser/gtk/standard_menus.cc (working copy)
@@ -12,6 +12,7 @@
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/encoding_menu_controller.h"
+#include "chrome/browser/profile.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -107,7 +108,31 @@
} // namespace
-const MenuCreateMaterial* GetStandardPageMenu(MenuGtk* encodings_menu) {
+const MenuCreateMaterial* GetStandardPageMenu(Profile* profile,
+ MenuGtk::Delegate* delegate) {
+ EncodingMenuController controller;
+ EncodingMenuController::EncodingMenuItemList items;
+ controller.GetEncodingMenuItems(profile, &items);
+
+ MenuGtk* encodings_menu = new MenuGtk(delegate, false);
+ GSList* radio_group = NULL;
+ for (EncodingMenuController::EncodingMenuItemList::const_iterator i =
+ items.begin();
+ i != items.end(); ++i) {
+ if (i == items.begin()) {
+ encodings_menu->AppendCheckMenuItemWithLabel(i->first,
+ UTF16ToUTF8(i->second));
+ } else if (i->first == 0) {
+ encodings_menu->AppendSeparator();
+ } else {
+ GtkWidget* item =
+ gtk_radio_menu_item_new_with_label(radio_group,
+ UTF16ToUTF8(i->second).c_str());
+ radio_group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item));
+ encodings_menu->AppendMenuItem(i->first, item);
+ }
+ }
+
// Find the encoding menu and attach this menu.
for (MenuCreateMaterial* entry = standard_page_menu_materials;
entry->type != MENU_END; ++entry) {
« no previous file with comments | « chrome/browser/gtk/standard_menus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698