Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 510793003: Remove ui::TouchEvent -> blink::WebTouchEvent conversion methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make method const. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "cc/output/compositor_frame.h" 13 #include "cc/output/compositor_frame.h"
14 #include "cc/output/compositor_frame_metadata.h" 14 #include "cc/output/compositor_frame_metadata.h"
15 #include "cc/output/copy_output_request.h" 15 #include "cc/output/copy_output_request.h"
16 #include "cc/surfaces/surface.h" 16 #include "cc/surfaces/surface.h"
17 #include "cc/surfaces/surface_manager.h" 17 #include "cc/surfaces/surface_manager.h"
18 #include "content/browser/browser_thread_impl.h" 18 #include "content/browser/browser_thread_impl.h"
19 #include "content/browser/compositor/resize_lock.h" 19 #include "content/browser/compositor/resize_lock.h"
20 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 20 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
21 #include "content/browser/frame_host/render_widget_host_view_guest.h" 21 #include "content/browser/frame_host/render_widget_host_view_guest.h"
22 #include "content/browser/renderer_host/input/web_input_event_util.h"
22 #include "content/browser/renderer_host/overscroll_controller.h" 23 #include "content/browser/renderer_host/overscroll_controller.h"
23 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 24 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
24 #include "content/browser/renderer_host/render_widget_host_delegate.h" 25 #include "content/browser/renderer_host/render_widget_host_delegate.h"
25 #include "content/browser/renderer_host/render_widget_host_impl.h" 26 #include "content/browser/renderer_host/render_widget_host_impl.h"
26 #include "content/common/gpu/client/gl_helper.h" 27 #include "content/common/gpu/client/gl_helper.h"
27 #include "content/common/gpu/gpu_messages.h" 28 #include "content/common/gpu/gpu_messages.h"
28 #include "content/common/host_shared_bitmap_manager.h" 29 #include "content/common/host_shared_bitmap_manager.h"
29 #include "content/common/input/synthetic_web_input_event_builders.h" 30 #include "content/common/input/synthetic_web_input_event_builders.h"
30 #include "content/common/input_messages.h" 31 #include "content/common/input_messages.h"
31 #include "content/common/view_messages.h" 32 #include "content/common/view_messages.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 262 }
262 263
263 // A lock that doesn't actually do anything to the compositor, and does not 264 // A lock that doesn't actually do anything to the compositor, and does not
264 // time out. 265 // time out.
265 class FakeResizeLock : public ResizeLock { 266 class FakeResizeLock : public ResizeLock {
266 public: 267 public:
267 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock) 268 FakeResizeLock(const gfx::Size new_size, bool defer_compositor_lock)
268 : ResizeLock(new_size, defer_compositor_lock) {} 269 : ResizeLock(new_size, defer_compositor_lock) {}
269 }; 270 };
270 271
272 void OnTouchEvent(ui::TouchEvent* event) override {
273 RenderWidgetHostViewAura::OnTouchEvent(event);
274 touch_event_ = CreateWebTouchEventFromMotionEvent(
275 pointer_state(), event->may_cause_scrolling());
276 }
277
271 bool has_resize_lock_; 278 bool has_resize_lock_;
272 gfx::Size last_frame_size_; 279 gfx::Size last_frame_size_;
273 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; 280 scoped_ptr<cc::CopyOutputRequest> last_copy_request_;
281 blink::WebTouchEvent touch_event_;
274 }; 282 };
275 283
276 // A layout manager that always resizes a child to the root window size. 284 // A layout manager that always resizes a child to the root window size.
277 class FullscreenLayoutManager : public aura::LayoutManager { 285 class FullscreenLayoutManager : public aura::LayoutManager {
278 public: 286 public:
279 explicit FullscreenLayoutManager(aura::Window* owner) : owner_(owner) {} 287 explicit FullscreenLayoutManager(aura::Window* owner) : owner_(owner) {}
280 ~FullscreenLayoutManager() override {} 288 ~FullscreenLayoutManager() override {}
281 289
282 // Overridden from aura::LayoutManager: 290 // Overridden from aura::LayoutManager:
283 void OnWindowResized() override { 291 void OnWindowResized() override {
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
3065 const NativeWebKeyboardEvent* event = delegate_.last_event(); 3073 const NativeWebKeyboardEvent* event = delegate_.last_event();
3066 EXPECT_NE(nullptr, event); 3074 EXPECT_NE(nullptr, event);
3067 if (event) { 3075 if (event) {
3068 EXPECT_EQ(key_event.key_code(), event->windowsKeyCode); 3076 EXPECT_EQ(key_event.key_code(), event->windowsKeyCode);
3069 EXPECT_EQ(ui::KeycodeConverter::DomCodeToNativeKeycode(key_event.code()), 3077 EXPECT_EQ(ui::KeycodeConverter::DomCodeToNativeKeycode(key_event.code()),
3070 event->nativeKeyCode); 3078 event->nativeKeyCode);
3071 } 3079 }
3072 } 3080 }
3073 3081
3074 } // namespace content 3082 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698