summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/views/custom_frame_window.cc21
-rw-r--r--chrome/views/custom_frame_window.h3
-rw-r--r--chrome/views/hwnd_view_container.h4
3 files changed, 20 insertions, 8 deletions
diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc
index 9372334..f2d7bea 100644
--- a/chrome/views/custom_frame_window.cc
+++ b/chrome/views/custom_frame_window.cc
@@ -911,16 +911,17 @@ void CustomFrameWindow::SizeWindowToDefault() {
///////////////////////////////////////////////////////////////////////////////
// CustomFrameWindow, HWNDViewContainer overrides:
+void CustomFrameWindow::OnEnterIdle(UINT reason, HWND window) {
+ ScopedVisibilityRemover remover(GetHWND());
+ DefWindowProc(GetHWND(), WM_ENTERIDLE, reason,
+ reinterpret_cast<LPARAM>(window));
+}
+
static void EnableMenuItem(HMENU menu, UINT command, bool enabled) {
UINT flags = MF_BYCOMMAND | (enabled ? MF_ENABLED : MF_DISABLED | MF_GRAYED);
EnableMenuItem(menu, command, flags);
}
-void CustomFrameWindow::OnEnterMenuLoop(bool is_track_popup_menu) {
- ScopedVisibilityRemover remover(GetHWND());
- DefWindowProc(GetHWND(), WM_ENTERMENULOOP, is_track_popup_menu, NULL);
-}
-
void CustomFrameWindow::OnInitMenu(HMENU menu) {
bool minimized = IsMinimized();
bool maximized = IsMaximized();
@@ -935,6 +936,16 @@ void CustomFrameWindow::OnInitMenu(HMENU menu) {
window_delegate()->CanMaximize() && !maximized);
EnableMenuItem(menu, SC_MINIMIZE,
window_delegate()->CanMaximize() && !minimized);
+
+ ScopedVisibilityRemover remover(GetHWND());
+ DefWindowProc(GetHWND(), WM_INITMENU, reinterpret_cast<WPARAM>(menu), NULL);
+}
+
+void CustomFrameWindow::OnInitMenuPopup(HMENU menu, UINT position,
+ BOOL is_system_menu) {
+ ScopedVisibilityRemover remover(GetHWND());
+ DefWindowProc(GetHWND(), WM_INITMENUPOPUP, reinterpret_cast<WPARAM>(menu),
+ MAKELPARAM(is_system_menu, position));
}
void CustomFrameWindow::OnMouseLeave() {
diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h
index 2682d17..0d89193 100644
--- a/chrome/views/custom_frame_window.h
+++ b/chrome/views/custom_frame_window.h
@@ -48,8 +48,9 @@ class CustomFrameWindow : public Window {
virtual void DisableInactiveRendering(bool disable);
// Overridden from HWNDViewContainer:
- virtual void OnEnterMenuLoop(bool is_track_popup_menu);
+ virtual void OnEnterIdle(UINT reason, HWND window);
virtual void OnInitMenu(HMENU menu);
+ virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu);
virtual void OnMouseLeave();
virtual LRESULT OnNCActivate(BOOL active);
virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param);
diff --git a/chrome/views/hwnd_view_container.h b/chrome/views/hwnd_view_container.h
index cd87f68..70f255b 100644
--- a/chrome/views/hwnd_view_container.h
+++ b/chrome/views/hwnd_view_container.h
@@ -191,7 +191,7 @@ class HWNDViewContainer : public ViewContainer,
MSG_WM_DESTROY(OnDestroy)
MSG_WM_ERASEBKGND(OnEraseBkgnd)
MSG_WM_ENDSESSION(OnEndSession)
- MSG_WM_ENTERMENULOOP(OnEnterMenuLoop)
+ MSG_WM_ENTERIDLE(OnEnterIdle)
MSG_WM_EXITMENULOOP(OnExitMenuLoop)
MSG_WM_GETMINMAXINFO(OnGetMinMaxInfo)
MSG_WM_HSCROLL(OnHScroll)
@@ -359,7 +359,7 @@ class HWNDViewContainer : public ViewContainer,
// leak a few things.
virtual void OnDestroy();
virtual void OnEndSession(BOOL ending, UINT logoff) { SetMsgHandled(FALSE); }
- virtual void OnEnterMenuLoop(BOOL is_track_popup_menu) {
+ virtual void OnEnterIdle(UINT reason, HWND window) {
SetMsgHandled(FALSE);
}
virtual void OnExitMenuLoop(BOOL is_track_popup_menu) { SetMsgHandled(FALSE); }