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 | 10 |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value)); | 752 hwnd(), DWMWA_TRANSITIONS_FORCEDISABLED, &dwm_value, sizeof(dwm_value)); |
753 } | 753 } |
754 } | 754 } |
755 | 755 |
756 bool HWNDMessageHandler::SetTitle(const base::string16& title) { | 756 bool HWNDMessageHandler::SetTitle(const base::string16& title) { |
757 base::string16 current_title; | 757 base::string16 current_title; |
758 size_t len_with_null = GetWindowTextLength(hwnd()) + 1; | 758 size_t len_with_null = GetWindowTextLength(hwnd()) + 1; |
759 if (len_with_null == 1 && title.length() == 0) | 759 if (len_with_null == 1 && title.length() == 0) |
760 return false; | 760 return false; |
761 if (len_with_null - 1 == title.length() && | 761 if (len_with_null - 1 == title.length() && |
762 GetWindowText( | 762 GetWindowText(hwnd(), |
763 hwnd(), WriteInto(¤t_title, len_with_null), len_with_null) && | 763 base::WriteInto(¤t_title, len_with_null), |
| 764 len_with_null) && |
764 current_title == title) | 765 current_title == title) |
765 return false; | 766 return false; |
766 SetWindowText(hwnd(), title.c_str()); | 767 SetWindowText(hwnd(), title.c_str()); |
767 return true; | 768 return true; |
768 } | 769 } |
769 | 770 |
770 void HWNDMessageHandler::SetCursor(HCURSOR cursor) { | 771 void HWNDMessageHandler::SetCursor(HCURSOR cursor) { |
771 if (cursor) { | 772 if (cursor) { |
772 previous_cursor_ = ::SetCursor(cursor); | 773 previous_cursor_ = ::SetCursor(cursor); |
773 current_cursor_ = cursor; | 774 current_cursor_ = cursor; |
(...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); | 2739 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); |
2739 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); | 2740 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); |
2740 } | 2741 } |
2741 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want | 2742 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want |
2742 // to notify our children too, since we can have MDI child windows who need to | 2743 // to notify our children too, since we can have MDI child windows who need to |
2743 // update their appearance. | 2744 // update their appearance. |
2744 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); | 2745 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); |
2745 } | 2746 } |
2746 | 2747 |
2747 } // namespace views | 2748 } // namespace views |
OLD | NEW |