| 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 <tchar.h> | 10 #include <tchar.h> |
| 11 | 11 |
| 12 #include <utility> | 12 #include <utility> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
| 16 #include "base/debug/alias.h" | 16 #include "base/debug/alias.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
| 20 #include "base/threading/thread_task_runner_handle.h" | 20 #include "base/threading/thread_task_runner_handle.h" |
| 21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
| 22 #include "base/win/scoped_gdi_object.h" | 22 #include "base/win/scoped_gdi_object.h" |
| 23 #include "base/win/windows_version.h" | 23 #include "base/win/windows_version.h" |
| 24 #include "ui/base/touch/touch_enabled.h" | |
| 25 #include "ui/base/view_prop.h" | 24 #include "ui/base/view_prop.h" |
| 26 #include "ui/base/win/internal_constants.h" | 25 #include "ui/base/win/internal_constants.h" |
| 27 #include "ui/base/win/lock_state.h" | 26 #include "ui/base/win/lock_state.h" |
| 28 #include "ui/base/win/mouse_wheel_util.h" | 27 #include "ui/base/win/mouse_wheel_util.h" |
| 29 #include "ui/base/win/shell.h" | 28 #include "ui/base/win/shell.h" |
| 30 #include "ui/base/win/touch_input.h" | 29 #include "ui/base/win/touch_input.h" |
| 31 #include "ui/display/win/dpi.h" | 30 #include "ui/display/win/dpi.h" |
| 32 #include "ui/display/win/screen_win.h" | 31 #include "ui/display/win/screen_win.h" |
| 33 #include "ui/events/event.h" | 32 #include "ui/events/event.h" |
| 34 #include "ui/events/event_utils.h" | 33 #include "ui/events/event_utils.h" |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 | 1336 |
| 1338 if (!delegate_->HasFrame()) { | 1337 if (!delegate_->HasFrame()) { |
| 1339 SetWindowLong(hwnd(), GWL_STYLE, | 1338 SetWindowLong(hwnd(), GWL_STYLE, |
| 1340 GetWindowLong(hwnd(), GWL_STYLE) & ~WS_CAPTION); | 1339 GetWindowLong(hwnd(), GWL_STYLE) & ~WS_CAPTION); |
| 1341 SendFrameChanged(); | 1340 SendFrameChanged(); |
| 1342 } | 1341 } |
| 1343 | 1342 |
| 1344 // Get access to a modifiable copy of the system menu. | 1343 // Get access to a modifiable copy of the system menu. |
| 1345 GetSystemMenu(hwnd(), false); | 1344 GetSystemMenu(hwnd(), false); |
| 1346 | 1345 |
| 1347 if (ui::AreTouchEventsEnabled()) | 1346 RegisterTouchWindow(hwnd(), TWF_WANTPALM); |
| 1348 RegisterTouchWindow(hwnd(), TWF_WANTPALM); | |
| 1349 | 1347 |
| 1350 // We need to allow the delegate to size its contents since the window may not | 1348 // We need to allow the delegate to size its contents since the window may not |
| 1351 // receive a size notification when its initial bounds are specified at window | 1349 // receive a size notification when its initial bounds are specified at window |
| 1352 // creation time. | 1350 // creation time. |
| 1353 ClientAreaSizeChanged(); | 1351 ClientAreaSizeChanged(); |
| 1354 | 1352 |
| 1355 delegate_->HandleCreate(); | 1353 delegate_->HandleCreate(); |
| 1356 | 1354 |
| 1357 windows_session_change_observer_.reset(new WindowsSessionChangeObserver( | 1355 windows_session_change_observer_.reset(new WindowsSessionChangeObserver( |
| 1358 base::Bind(&HWNDMessageHandler::OnSessionChange, | 1356 base::Bind(&HWNDMessageHandler::OnSessionChange, |
| (...skipping 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 MONITORINFO monitor_info = {sizeof(monitor_info)}; | 2747 MONITORINFO monitor_info = {sizeof(monitor_info)}; |
| 2750 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), | 2748 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), |
| 2751 &monitor_info); | 2749 &monitor_info); |
| 2752 gfx::Rect shrunk_rect(monitor_info.rcMonitor); | 2750 gfx::Rect shrunk_rect(monitor_info.rcMonitor); |
| 2753 shrunk_rect.set_height(shrunk_rect.height() - 1); | 2751 shrunk_rect.set_height(shrunk_rect.height() - 1); |
| 2754 background_fullscreen_hack_ = true; | 2752 background_fullscreen_hack_ = true; |
| 2755 SetBoundsInternal(shrunk_rect, false); | 2753 SetBoundsInternal(shrunk_rect, false); |
| 2756 } | 2754 } |
| 2757 | 2755 |
| 2758 } // namespace views | 2756 } // namespace views |
| OLD | NEW |