OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/win/hwnd_message_handler.h" | 5 #include "ui/views/win/hwnd_message_handler.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 // DefWindowProc() may have destroyed the window in a nested message loop. | 915 // DefWindowProc() may have destroyed the window in a nested message loop. |
916 if (!::IsWindow(window)) | 916 if (!::IsWindow(window)) |
917 return result; | 917 return result; |
918 | 918 |
919 if (delegate_) | 919 if (delegate_) |
920 delegate_->PostHandleMSG(message, w_param, l_param); | 920 delegate_->PostHandleMSG(message, w_param, l_param); |
921 if (message == WM_NCDESTROY) { | 921 if (message == WM_NCDESTROY) { |
922 #if !defined(USE_AURA) | 922 #if !defined(USE_AURA) |
923 base::MessageLoopForUI::current()->RemoveObserver(this); | 923 base::MessageLoopForUI::current()->RemoveObserver(this); |
924 #endif | 924 #endif |
| 925 SetDestroyed(); |
925 if (delegate_) | 926 if (delegate_) |
926 delegate_->HandleDestroyed(); | 927 delegate_->HandleDestroyed(); |
927 } | 928 } |
928 | 929 |
929 // Only top level widget should store/restore focus. | 930 // Only top level widget should store/restore focus. |
930 if (message == WM_ACTIVATE && delegate_->CanSaveFocus()) | 931 if (message == WM_ACTIVATE && delegate_->CanSaveFocus()) |
931 PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param)); | 932 PostProcessActivateMessage(LOWORD(w_param), !!HIWORD(w_param)); |
932 | 933 |
933 if (message == WM_ENABLE && restore_focus_when_enabled_) { | 934 if (message == WM_ENABLE && restore_focus_when_enabled_) { |
934 // This path should be executed only for top level as | 935 // This path should be executed only for top level as |
(...skipping 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2255 SetMsgHandled(FALSE); | 2256 SetMsgHandled(FALSE); |
2256 } | 2257 } |
2257 | 2258 |
2258 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { | 2259 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { |
2259 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); | 2260 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); |
2260 for (size_t i = 0; i < touch_events.size() && ref; ++i) | 2261 for (size_t i = 0; i < touch_events.size() && ref; ++i) |
2261 delegate_->HandleTouchEvent(touch_events[i]); | 2262 delegate_->HandleTouchEvent(touch_events[i]); |
2262 } | 2263 } |
2263 | 2264 |
2264 } // namespace views | 2265 } // namespace views |
OLD | NEW |