| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 } | 746 } |
| 747 | 747 |
| 748 void HWNDMessageHandler::SetVisibilityChangedAnimationsEnabled(bool enabled) { | 748 void HWNDMessageHandler::SetVisibilityChangedAnimationsEnabled(bool enabled) { |
| 749 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { | 749 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
| 750 int dwm_value = enabled ? FALSE : TRUE; | 750 int dwm_value = enabled ? FALSE : TRUE; |
| 751 DwmSetWindowAttribute( | 751 DwmSetWindowAttribute( |
| 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 string16& title) { | 756 bool HWNDMessageHandler::SetTitle(const base::string16& title) { |
| 757 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( |
| 763 hwnd(), WriteInto(¤t_title, len_with_null), len_with_null) && | 763 hwnd(), WriteInto(¤t_title, len_with_null), len_with_null) && |
| 764 current_title == title) | 764 current_title == title) |
| 765 return false; | 765 return false; |
| 766 SetWindowText(hwnd(), title.c_str()); | 766 SetWindowText(hwnd(), title.c_str()); |
| 767 return true; | 767 return true; |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 SetMsgHandled(FALSE); | 2241 SetMsgHandled(FALSE); |
| 2242 } | 2242 } |
| 2243 | 2243 |
| 2244 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { | 2244 void HWNDMessageHandler::HandleTouchEvents(const TouchEvents& touch_events) { |
| 2245 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); | 2245 base::WeakPtr<HWNDMessageHandler> ref(weak_factory_.GetWeakPtr()); |
| 2246 for (size_t i = 0; i < touch_events.size() && ref; ++i) | 2246 for (size_t i = 0; i < touch_events.size() && ref; ++i) |
| 2247 delegate_->HandleTouchEvent(touch_events[i]); | 2247 delegate_->HandleTouchEvent(touch_events[i]); |
| 2248 } | 2248 } |
| 2249 | 2249 |
| 2250 } // namespace views | 2250 } // namespace views |
| OLD | NEW |