OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/platform_window/win/win_window.h" | 5 #include "ui/platform_window/win/win_window.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> |
| 8 |
8 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
9 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
10 #include "ui/events/event_utils.h" | 11 #include "ui/events/event_utils.h" |
11 #include "ui/gfx/win/msg_util.h" | 12 #include "ui/gfx/win/msg_util.h" |
12 #include "ui/platform_window/platform_window_delegate.h" | 13 #include "ui/platform_window/platform_window_delegate.h" |
13 | 14 |
14 namespace ui { | 15 namespace ui { |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 120 } |
120 | 121 |
121 PlatformImeController* WinWindow::GetPlatformImeController() { | 122 PlatformImeController* WinWindow::GetPlatformImeController() { |
122 return nullptr; | 123 return nullptr; |
123 } | 124 } |
124 | 125 |
125 LRESULT WinWindow::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { | 126 LRESULT WinWindow::OnMouseRange(UINT message, WPARAM w_param, LPARAM l_param) { |
126 MSG msg = { hwnd(), message, w_param, l_param, | 127 MSG msg = { hwnd(), message, w_param, l_param, |
127 static_cast<DWORD>(GetMessageTime()), | 128 static_cast<DWORD>(GetMessageTime()), |
128 { CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } }; | 129 { CR_GET_X_LPARAM(l_param), CR_GET_Y_LPARAM(l_param) } }; |
129 scoped_ptr<Event> event = EventFromNative(msg); | 130 std::unique_ptr<Event> event = EventFromNative(msg); |
130 if (IsMouseEventFromTouch(message)) | 131 if (IsMouseEventFromTouch(message)) |
131 event->set_flags(event->flags() | EF_FROM_TOUCH); | 132 event->set_flags(event->flags() | EF_FROM_TOUCH); |
132 if (!(event->flags() & ui::EF_IS_NON_CLIENT)) | 133 if (!(event->flags() & ui::EF_IS_NON_CLIENT)) |
133 delegate_->DispatchEvent(event.get()); | 134 delegate_->DispatchEvent(event.get()); |
134 SetMsgHandled(event->handled()); | 135 SetMsgHandled(event->handled()); |
135 return 0; | 136 return 0; |
136 } | 137 } |
137 | 138 |
138 LRESULT WinWindow::OnCaptureChanged(UINT message, | 139 LRESULT WinWindow::OnCaptureChanged(UINT message, |
139 WPARAM w_param, | 140 WPARAM w_param, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 192 |
192 namespace test { | 193 namespace test { |
193 | 194 |
194 // static | 195 // static |
195 void SetUsePopupAsRootWindowForTest(bool use) { | 196 void SetUsePopupAsRootWindowForTest(bool use) { |
196 use_popup_as_root_window_for_test = use; | 197 use_popup_as_root_window_for_test = use; |
197 } | 198 } |
198 | 199 |
199 } // namespace test | 200 } // namespace test |
200 } // namespace ui | 201 } // namespace ui |
OLD | NEW |