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 <oleacc.h> | 8 #include <oleacc.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <wtsapi32.h> | 10 #include <wtsapi32.h> |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 | 906 |
907 void HWNDMessageHandler::DispatchKeyEventPostIME(const ui::KeyEvent& key) { | 907 void HWNDMessageHandler::DispatchKeyEventPostIME(const ui::KeyEvent& key) { |
908 SetMsgHandled(delegate_->HandleKeyEvent(key)); | 908 SetMsgHandled(delegate_->HandleKeyEvent(key)); |
909 } | 909 } |
910 | 910 |
911 //////////////////////////////////////////////////////////////////////////////// | 911 //////////////////////////////////////////////////////////////////////////////// |
912 // HWNDMessageHandler, gfx::WindowImpl overrides: | 912 // HWNDMessageHandler, gfx::WindowImpl overrides: |
913 | 913 |
914 HICON HWNDMessageHandler::GetDefaultWindowIcon() const { | 914 HICON HWNDMessageHandler::GetDefaultWindowIcon() const { |
915 if (use_system_default_icon_) | 915 if (use_system_default_icon_) |
916 return NULL; | 916 return nullptr; |
917 return ViewsDelegate::views_delegate ? | 917 return ViewsDelegate::views_delegate |
918 ViewsDelegate::views_delegate->GetDefaultWindowIcon() : NULL; | 918 ? ViewsDelegate::views_delegate->GetDefaultWindowIcon() |
| 919 : nullptr; |
| 920 } |
| 921 |
| 922 HICON HWNDMessageHandler::GetSmallWindowIcon() const { |
| 923 if (use_system_default_icon_) |
| 924 return nullptr; |
| 925 return ViewsDelegate::views_delegate |
| 926 ? ViewsDelegate::views_delegate->GetSmallWindowIcon() |
| 927 : nullptr; |
919 } | 928 } |
920 | 929 |
921 LRESULT HWNDMessageHandler::OnWndProc(UINT message, | 930 LRESULT HWNDMessageHandler::OnWndProc(UINT message, |
922 WPARAM w_param, | 931 WPARAM w_param, |
923 LPARAM l_param) { | 932 LPARAM l_param) { |
924 HWND window = hwnd(); | 933 HWND window = hwnd(); |
925 LRESULT result = 0; | 934 LRESULT result = 0; |
926 | 935 |
927 if (delegate_ && delegate_->PreHandleMSG(message, w_param, l_param, &result)) | 936 if (delegate_ && delegate_->PreHandleMSG(message, w_param, l_param, &result)) |
928 return result; | 937 return result; |
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2512 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2521 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
2513 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2522 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
2514 } | 2523 } |
2515 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2524 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
2516 // to notify our children too, since we can have MDI child windows who need to | 2525 // to notify our children too, since we can have MDI child windows who need to |
2517 // update their appearance. | 2526 // update their appearance. |
2518 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2527 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
2519 } | 2528 } |
2520 | 2529 |
2521 } // namespace views | 2530 } // namespace views |
OLD | NEW |