| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); | 1395 FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 void RenderWidget::QueueSyntheticGesture( | 1398 void RenderWidget::QueueSyntheticGesture( |
| 1399 std::unique_ptr<SyntheticGestureParams> gesture_params, | 1399 std::unique_ptr<SyntheticGestureParams> gesture_params, |
| 1400 const SyntheticGestureCompletionCallback& callback) { | 1400 const SyntheticGestureCompletionCallback& callback) { |
| 1401 DCHECK(!callback.is_null()); | 1401 DCHECK(!callback.is_null()); |
| 1402 | 1402 |
| 1403 pending_synthetic_gesture_callbacks_.push(callback); | 1403 pending_synthetic_gesture_callbacks_.push(callback); |
| 1404 | 1404 |
| 1405 QueueSyntheticGesture(std::move(gesture_params)); |
| 1406 } |
| 1407 |
| 1408 void RenderWidget::QueueSyntheticGesture( |
| 1409 std::unique_ptr<SyntheticGestureParams> gesture_params) { |
| 1405 SyntheticGesturePacket gesture_packet; | 1410 SyntheticGesturePacket gesture_packet; |
| 1406 gesture_packet.set_gesture_params(std::move(gesture_params)); | 1411 gesture_packet.set_gesture_params(std::move(gesture_params)); |
| 1407 | |
| 1408 Send(new InputHostMsg_QueueSyntheticGesture(routing_id_, gesture_packet)); | 1412 Send(new InputHostMsg_QueueSyntheticGesture(routing_id_, gesture_packet)); |
| 1409 } | 1413 } |
| 1410 | 1414 |
| 1411 void RenderWidget::Close() { | 1415 void RenderWidget::Close() { |
| 1412 screen_metrics_emulator_.reset(); | 1416 screen_metrics_emulator_.reset(); |
| 1413 WillCloseLayerTreeView(); | 1417 WillCloseLayerTreeView(); |
| 1414 compositor_.reset(); | 1418 compositor_.reset(); |
| 1415 if (webwidget_) { | 1419 if (webwidget_) { |
| 1416 webwidget_->close(); | 1420 webwidget_->close(); |
| 1417 webwidget_ = nullptr; | 1421 webwidget_ = nullptr; |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2085 } | 2089 } |
| 2086 | 2090 |
| 2087 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2091 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
| 2088 return | 2092 return |
| 2089 screen_metrics_emulator_ ? | 2093 screen_metrics_emulator_ ? |
| 2090 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2094 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
| 2091 device_scale_factor_; | 2095 device_scale_factor_; |
| 2092 } | 2096 } |
| 2093 | 2097 |
| 2094 } // namespace content | 2098 } // namespace content |
| OLD | NEW |