summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_external_win.cc15
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_external_win.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/render_view_context_menu_external_win.cc b/chrome/browser/tab_contents/render_view_context_menu_external_win.cc
index a9667c9..83b88031 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_external_win.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu_external_win.cc
@@ -22,3 +22,18 @@ void RenderViewContextMenuExternalWin::AppendMenuItem(int id) {
RenderViewContextMenuWin::AppendMenuItem(id);
}
}
+
+void RenderViewContextMenuExternalWin::DoInit() {
+ RenderViewContextMenuWin::DoInit();
+ // The external tab container needs to be notified by command
+ // and not by index. So we are turning off the MNS_NOTIFYBYPOS
+ // style.
+ HMENU menu = GetMenuHandle();
+ DCHECK(menu != NULL);
+
+ MENUINFO mi = {0};
+ mi.cbSize = sizeof(mi);
+ mi.fMask = MIM_STYLE | MIM_MENUDATA;
+ mi.dwMenuData = reinterpret_cast<ULONG_PTR>(this);
+ SetMenuInfo(menu, &mi);
+}
diff --git a/chrome/browser/tab_contents/render_view_context_menu_external_win.h b/chrome/browser/tab_contents/render_view_context_menu_external_win.h
index 0bd6f24..cee9418 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_external_win.h
+++ b/chrome/browser/tab_contents/render_view_context_menu_external_win.h
@@ -23,6 +23,9 @@ class RenderViewContextMenuExternalWin : public RenderViewContextMenuWin {
// RenderViewContextMenuWin overrides --------------------------------------
virtual void AppendMenuItem(int id);
+ // RenderViewContextMenu override
+ virtual void DoInit();
+
private:
// Contains the list of context menu ids to be disabled.
std::vector<int> disabled_menu_ids_;