diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-21 02:10:17 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-21 02:10:17 +0000 |
commit | 0e5b85c0830abc50fb5df50b0fc75a25e18824f1 (patch) | |
tree | a9956bd4bbea3bb368965e3ccc9a602280dbe308 /ui | |
parent | 5e835d203f202f2972f9624b38665d048acb503e (diff) | |
download | chromium_src-0e5b85c0830abc50fb5df50b0fc75a25e18824f1.zip chromium_src-0e5b85c0830abc50fb5df50b0fc75a25e18824f1.tar.gz chromium_src-0e5b85c0830abc50fb5df50b0fc75a25e18824f1.tar.bz2 |
Move more message handlers from NativeWidgetWin to HWNDMessageHandler.
Buildbots (not trybots) were giving grief on past iteration of this CL:
http://codereview.chromium.org/10832345/
... so I am splitting it into smaller pieces to help identify what piece was the cause.
http://crbug.com/142962
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10832345
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/views/widget/native_widget_win.cc | 40 |
1 files changed, 5 insertions, 35 deletions
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc index 83a5d23..bdcc2e5 100644 --- a/ui/views/widget/native_widget_win.cc +++ b/ui/views/widget/native_widget_win.cc @@ -1461,28 +1461,13 @@ LRESULT NativeWidgetWin::OnImeMessages(UINT message, } void NativeWidgetWin::OnInitMenu(HMENU menu) { - bool is_fullscreen = IsFullscreen(); - bool is_minimized = IsMinimized(); - bool is_maximized = IsMaximized(); - bool is_restored = !is_fullscreen && !is_minimized && !is_maximized; - - ScopedRedrawLock lock(this); - EnableMenuItem(menu, SC_RESTORE, is_minimized || is_maximized); - EnableMenuItem(menu, SC_MOVE, is_restored); - EnableMenuItem(menu, SC_SIZE, - GetWidget()->widget_delegate()->CanResize() && is_restored); - EnableMenuItem(menu, SC_MAXIMIZE, - GetWidget()->widget_delegate()->CanMaximize() && - !is_fullscreen && !is_maximized); - EnableMenuItem(menu, SC_MINIMIZE, - GetWidget()->widget_delegate()->CanMaximize() && - !is_minimized); + message_handler_->OnInitMenu(menu); } void NativeWidgetWin::OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu) { - SetMsgHandled(FALSE); + message_handler_->OnInitMenuPopup(); } void NativeWidgetWin::OnInputLangChange(DWORD character_set, @@ -1493,22 +1478,11 @@ void NativeWidgetWin::OnInputLangChange(DWORD character_set, LRESULT NativeWidgetWin::OnKeyEvent(UINT message, WPARAM w_param, LPARAM l_param) { - MSG msg = { hwnd(), message, w_param, l_param }; - ui::KeyEvent key(msg, message == WM_CHAR); - InputMethod* input_method = GetWidget()->GetInputMethodDirect(); - if (input_method) - input_method->DispatchKeyEvent(key); - else - DispatchKeyEventPostIME(key); - return 0; + return message_handler_->OnKeyEvent(message, w_param, l_param); } void NativeWidgetWin::OnKillFocus(HWND focused_window) { - delegate_->OnNativeBlur(focused_window); - InputMethod* input_method = GetWidget()->GetInputMethodDirect(); - if (input_method) - input_method->OnBlur(); - SetMsgHandled(FALSE); + message_handler_->OnKillFocus(focused_window); } LRESULT NativeWidgetWin::OnMouseActivate(UINT message, @@ -1936,11 +1910,7 @@ LRESULT NativeWidgetWin::OnSetCursor(UINT message, } void NativeWidgetWin::OnSetFocus(HWND old_focused_window) { - delegate_->OnNativeFocus(old_focused_window); - InputMethod* input_method = GetWidget()->GetInputMethodDirect(); - if (input_method) - input_method->OnFocus(); - SetMsgHandled(FALSE); + message_handler_->OnSetFocus(old_focused_window); } LRESULT NativeWidgetWin::OnSetIcon(UINT size_type, HICON new_icon) { |