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 "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); | 1379 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); |
1380 } | 1380 } |
1381 | 1381 |
1382 void RenderWidget::QueueSyntheticGesture( | 1382 void RenderWidget::QueueSyntheticGesture( |
1383 std::unique_ptr<SyntheticGestureParams> gesture_params, | 1383 std::unique_ptr<SyntheticGestureParams> gesture_params, |
1384 const SyntheticGestureCompletionCallback& callback) { | 1384 const SyntheticGestureCompletionCallback& callback) { |
1385 DCHECK(!callback.is_null()); | 1385 DCHECK(!callback.is_null()); |
1386 | 1386 |
1387 pending_synthetic_gesture_callbacks_.push(callback); | 1387 pending_synthetic_gesture_callbacks_.push(callback); |
1388 | 1388 |
| 1389 QueueSyntheticGesture(std::move(gesture_params)); |
| 1390 } |
| 1391 |
| 1392 void RenderWidget::QueueSyntheticGesture( |
| 1393 std::unique_ptr<SyntheticGestureParams> gesture_params) { |
1389 SyntheticGesturePacket gesture_packet; | 1394 SyntheticGesturePacket gesture_packet; |
1390 gesture_packet.set_gesture_params(std::move(gesture_params)); | 1395 gesture_packet.set_gesture_params(std::move(gesture_params)); |
1391 | |
1392 Send(new InputHostMsg_QueueSyntheticGesture(routing_id_, gesture_packet)); | 1396 Send(new InputHostMsg_QueueSyntheticGesture(routing_id_, gesture_packet)); |
1393 } | 1397 } |
1394 | 1398 |
1395 void RenderWidget::Close() { | 1399 void RenderWidget::Close() { |
1396 screen_metrics_emulator_.reset(); | 1400 screen_metrics_emulator_.reset(); |
1397 WillCloseLayerTreeView(); | 1401 WillCloseLayerTreeView(); |
1398 compositor_.reset(); | 1402 compositor_.reset(); |
1399 if (webwidget_) { | 1403 if (webwidget_) { |
1400 webwidget_->close(); | 1404 webwidget_->close(); |
1401 webwidget_ = NULL; | 1405 webwidget_ = NULL; |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2074 } | 2078 } |
2075 | 2079 |
2076 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2080 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2077 return | 2081 return |
2078 screen_metrics_emulator_ ? | 2082 screen_metrics_emulator_ ? |
2079 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2083 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2080 device_scale_factor_; | 2084 device_scale_factor_; |
2081 } | 2085 } |
2082 | 2086 |
2083 } // namespace content | 2087 } // namespace content |
OLD | NEW |