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(compositor_deps, | 56 : RenderWidget(compositor_deps, |
57 blink::WebPopupTypeNone, | 57 blink::WebPopupTypeNone, |
58 ScreenInfo(), | 58 ScreenInfo(), |
59 false, | 59 false, |
60 false, | 60 false, |
61 false), | 61 false), |
62 always_overscroll_(false) { | 62 always_overscroll_(false) { |
63 webwidget_internal_ = &mock_webwidget_; | 63 webwidget_internal_ = &mock_webwidget_; |
64 InitRoutingID(++next_routing_id_); | 64 // A RenderWidget is not fully initialized until it has a routing ID. |
| 65 SetRoutingID(++next_routing_id_); |
65 } | 66 } |
66 | 67 |
67 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { | 68 void SetTouchRegion(const std::vector<gfx::Rect>& rects) { |
68 rects_ = rects; | 69 rects_ = rects; |
69 } | 70 } |
70 | 71 |
71 void SendInputEvent(const blink::WebInputEvent& event) { | 72 void SendInputEvent(const blink::WebInputEvent& event) { |
72 OnHandleInputEvent( | 73 OnHandleInputEvent( |
73 &event, ui::LatencyInfo(), | 74 &event, ui::LatencyInfo(), |
74 ui::WebInputEventTraits::ShouldBlockEventStream(event) | 75 ui::WebInputEventTraits::ShouldBlockEventStream(event) |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 class PopupRenderWidget : public RenderWidget { | 372 class PopupRenderWidget : public RenderWidget { |
372 public: | 373 public: |
373 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) | 374 explicit PopupRenderWidget(CompositorDependencies* compositor_deps) |
374 : RenderWidget(compositor_deps, | 375 : RenderWidget(compositor_deps, |
375 blink::WebPopupTypePage, | 376 blink::WebPopupTypePage, |
376 ScreenInfo(), | 377 ScreenInfo(), |
377 false, | 378 false, |
378 false, | 379 false, |
379 false) { | 380 false) { |
380 webwidget_internal_ = &mock_webwidget_; | 381 webwidget_internal_ = &mock_webwidget_; |
381 InitRoutingID(1); | 382 // A RenderWidget is not fully initialized until it has a routing ID. |
| 383 SetRoutingID(1); |
382 did_show_ = true; | 384 did_show_ = true; |
383 } | 385 } |
384 | 386 |
385 IPC::TestSink* sink() { return &sink_; } | 387 IPC::TestSink* sink() { return &sink_; } |
386 | 388 |
387 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } | 389 MockWebWidget* mock_webwidget() { return &mock_webwidget_; } |
388 | 390 |
389 void SetScreenMetricsEmulationParameters( | 391 void SetScreenMetricsEmulationParameters( |
390 bool, | 392 bool, |
391 const blink::WebDeviceEmulationParams&) override {} | 393 const blink::WebDeviceEmulationParams&) override {} |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 blink::WebRect popup_emulated_rect(130, 170, 100, 400); | 488 blink::WebRect popup_emulated_rect(130, 170, 100, 400); |
487 widget()->setWindowRect(popup_emulated_rect); | 489 widget()->setWindowRect(popup_emulated_rect); |
488 | 490 |
489 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); | 491 EXPECT_EQ(popup_emulated_rect.x, widget()->windowRect().x); |
490 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); | 492 EXPECT_EQ(popup_emulated_rect.y, widget()->windowRect().y); |
491 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); | 493 EXPECT_EQ(popup_emulated_rect.x, widget()->viewRect().x); |
492 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); | 494 EXPECT_EQ(popup_emulated_rect.y, widget()->viewRect().y); |
493 } | 495 } |
494 | 496 |
495 } // namespace content | 497 } // namespace content |
OLD | NEW |