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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME); | 1986 UpdateTextInputState(ShowIme::IF_NEEDED, ChangeSource::FROM_NON_IME); |
1987 } | 1987 } |
1988 #endif | 1988 #endif |
1989 } | 1989 } |
1990 | 1990 |
1991 void RenderWidget::didOverscroll( | 1991 void RenderWidget::didOverscroll( |
1992 const blink::WebFloatSize& unusedDelta, | 1992 const blink::WebFloatSize& unusedDelta, |
1993 const blink::WebFloatSize& accumulatedRootOverScroll, | 1993 const blink::WebFloatSize& accumulatedRootOverScroll, |
1994 const blink::WebFloatPoint& position, | 1994 const blink::WebFloatPoint& position, |
1995 const blink::WebFloatSize& velocity) { | 1995 const blink::WebFloatSize& velocity) { |
| 1996 #if defined(OS_MACOSX) |
| 1997 // On OSX the user can disable the elastic overscroll effect. If that's the |
| 1998 // case, don't forward the overscroll notification. |
| 1999 DCHECK(compositor_deps()); |
| 2000 if (!compositor_deps()->IsElasticOverscrollEnabled()) |
| 2001 return; |
| 2002 #endif |
1996 input_handler_->DidOverscrollFromBlink(unusedDelta, accumulatedRootOverScroll, | 2003 input_handler_->DidOverscrollFromBlink(unusedDelta, accumulatedRootOverScroll, |
1997 position, velocity); | 2004 position, velocity); |
1998 } | 2005 } |
1999 | 2006 |
2000 void RenderWidget::StartCompositor() { | 2007 void RenderWidget::StartCompositor() { |
2001 if (!is_hidden()) | 2008 if (!is_hidden()) |
2002 compositor_->setVisible(true); | 2009 compositor_->setVisible(true); |
2003 } | 2010 } |
2004 | 2011 |
2005 RenderWidgetCompositor* RenderWidget::compositor() const { | 2012 RenderWidgetCompositor* RenderWidget::compositor() const { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2148 } | 2155 } |
2149 | 2156 |
2150 float RenderWidget::GetOriginalDeviceScaleFactor() const { | 2157 float RenderWidget::GetOriginalDeviceScaleFactor() const { |
2151 return | 2158 return |
2152 screen_metrics_emulator_ ? | 2159 screen_metrics_emulator_ ? |
2153 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : | 2160 screen_metrics_emulator_->original_screen_info().deviceScaleFactor : |
2154 device_scale_factor_; | 2161 device_scale_factor_; |
2155 } | 2162 } |
2156 | 2163 |
2157 } // namespace content | 2164 } // namespace content |
OLD | NEW |