| 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 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 DCHECK(webwidget_); | 2011 DCHECK(webwidget_); |
| 2012 if (webwidget_->textInputInfo().value.isEmpty()) | 2012 if (webwidget_->textInputInfo().value.isEmpty()) |
| 2013 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); | 2013 UpdateTextInputState(ShowIme::HIDE_IME, ChangeSource::FROM_NON_IME); |
| 2014 else | 2014 else |
| 2015 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME); | 2015 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME); |
| 2016 } | 2016 } |
| 2017 #endif | 2017 #endif |
| 2018 } | 2018 } |
| 2019 | 2019 |
| 2020 void RenderWidget::didOverscroll( | 2020 void RenderWidget::didOverscroll( |
| 2021 const blink::WebFloatSize& unusedDelta, | 2021 const blink::WebFloatSize& overscrollDelta, |
| 2022 const blink::WebFloatSize& accumulatedRootOverScroll, | 2022 const blink::WebFloatSize& accumulatedOverscroll, |
| 2023 const blink::WebFloatPoint& position, | 2023 const blink::WebFloatPoint& position, |
| 2024 const blink::WebFloatSize& velocity) { | 2024 const blink::WebFloatSize& velocity) { |
| 2025 #if defined(OS_MACOSX) | 2025 #if defined(OS_MACOSX) |
| 2026 // On OSX the user can disable the elastic overscroll effect. If that's the | 2026 // On OSX the user can disable the elastic overscroll effect. If that's the |
| 2027 // case, don't forward the overscroll notification. | 2027 // case, don't forward the overscroll notification. |
| 2028 DCHECK(compositor_deps()); | 2028 DCHECK(compositor_deps()); |
| 2029 if (!compositor_deps()->IsElasticOverscrollEnabled()) | 2029 if (!compositor_deps()->IsElasticOverscrollEnabled()) |
| 2030 return; | 2030 return; |
| 2031 #endif | 2031 #endif |
| 2032 input_handler_->DidOverscrollFromBlink(unusedDelta, accumulatedRootOverScroll, | 2032 input_handler_->DidOverscrollFromBlink(overscrollDelta, accumulatedOverscroll, |
| 2033 position, velocity); | 2033 position, velocity); |
| 2034 } | 2034 } |
| 2035 | 2035 |
| 2036 void RenderWidget::StartCompositor() { | 2036 void RenderWidget::StartCompositor() { |
| 2037 if (!is_hidden()) | 2037 if (!is_hidden()) |
| 2038 compositor_->setVisible(true); | 2038 compositor_->setVisible(true); |
| 2039 } | 2039 } |
| 2040 | 2040 |
| 2041 RenderWidgetCompositor* RenderWidget::compositor() const { | 2041 RenderWidgetCompositor* RenderWidget::compositor() const { |
| 2042 return compositor_.get(); | 2042 return compositor_.get(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2186 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
| 2187 return | 2187 return |
| 2188 screen_metrics_emulator_ ? | 2188 screen_metrics_emulator_ ? |
| 2189 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2189 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
| 2190 device_scale_factor_; | 2190 device_scale_factor_; |
| 2191 } | 2191 } |
| 2192 | 2192 |
| 2193 } // namespace content | 2193 } // namespace content |
| OLD | NEW |