OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 public: | 54 public: |
55 explicit InteractiveRenderWidget(CompositorDependencies* compositor_deps) | 55 explicit InteractiveRenderWidget(CompositorDependencies* compositor_deps) |
56 : RenderWidget(++next_routing_id_, | 56 : RenderWidget(++next_routing_id_, |
57 compositor_deps, | 57 compositor_deps, |
58 blink::WebPopupTypeNone, | 58 blink::WebPopupTypeNone, |
59 ScreenInfo(), | 59 ScreenInfo(), |
60 false, | 60 false, |
61 false, | 61 false, |
62 false), | 62 false), |
63 always_overscroll_(false) { | 63 always_overscroll_(false) { |
64 Init(MSG_ROUTING_NONE, mock_webwidget()); | 64 Init(RenderWidget::ShowCallback(), mock_webwidget()); |
65 } | 65 } |
66 | 66 |
67 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { | 67 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { |
68 rects_ = rects; | 68 rects_ = rects; |
69 } | 69 } |
70 | 70 |
71 void SendInputEvent(const blink::WebInputEvent& event) { | 71 void SendInputEvent(const blink::WebInputEvent& event) { |
72 OnHandleInputEvent( | 72 OnHandleInputEvent( |
73 &event, ui::LatencyInfo(), | 73 &event, ui::LatencyInfo(), |
74 ui::WebInputEventTraits::ShouldBlockEventStream(event) | 74 ui::WebInputEventTraits::ShouldBlockEventStream(event) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 class PopupRenderWidget : public RenderWidget { | 376 class PopupRenderWidget : public RenderWidget { |
377 public: | 377 public: |
378 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) | 378 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) |
379 : RenderWidget(1, | 379 : RenderWidget(1, |
380 compositor_deps, | 380 compositor_deps, |
381 blink::WebPopupTypePage, | 381 blink::WebPopupTypePage, |
382 ScreenInfo(), | 382 ScreenInfo(), |
383 false, | 383 false, |
384 false, | 384 false, |
385 false) { | 385 false) { |
386 Init(MSG_ROUTING_NONE, mock_webwidget()); | 386 Init(RenderWidget::ShowCallback(), mock_webwidget()); |
387 did_show_ = true; | 387 did_show_ = true; |
388 } | 388 } |
389 | 389 |
390 IPC::TestSink* sink() { return &sink_; } | 390 IPC::TestSink* sink() { return &sink_; } |
391 | 391 |
392 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } | 392 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } |
393 | 393 |
394 void SetScreenMetricsEmulationParameters( | 394 void SetScreenMetricsEmulationParameters( |
395 bool, | 395 bool, |
396 const blink::WebDeviceEmulationParams&) override {} | 396 const blink::WebDeviceEmulationParams&) override {} |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 blink::WebRect popup_emulated_rect(130, 170, 100, 400); | 498 blink::WebRect popup_emulated_rect(130, 170, 100, 400); |
499 widget()->setWindowRect(popup_emulated_rect); | 499 widget()->setWindowRect(popup_emulated_rect); |
500 | 500 |
501 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); | 501 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); |
502 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); | 502 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); |
503 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); | 503 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); |
504 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); | 504 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); |
505 } | 505 } |
506 | 506 |
507 } // namespace content | 507 } // namespace content |
OLD | NEW |