| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index 7257b007bca385082e9e507b6c4678334854ab50..3ec8ee7bdd505ef8adf0bc61b68f1136984694f9 100644
|
| --- a/content/renderer/render_view_impl.cc
|
| +++ b/content/renderer/render_view_impl.cc
|
| @@ -431,6 +431,18 @@ static bool ShouldUseCompositedScrollingForFrames(
|
| return DeviceScaleEnsuresTextQuality(device_scale_factor);
|
| }
|
|
|
| +static bool ShouldUseCompositedSelectionUpdates() {
|
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| +
|
| + if (command_line.HasSwitch(switches::kDisableCompositedSelectionUpdates))
|
| + return false;
|
| +
|
| + if (command_line.HasSwitch(switches::kEnableCompositedSelectionUpdates))
|
| + return true;
|
| +
|
| + return false;
|
| +}
|
| +
|
| static bool ShouldUseUniversalAcceleratedCompositingForOverflowScroll() {
|
| const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
|
|
| @@ -751,6 +763,8 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) {
|
| ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
|
| webview()->settings()->setCompositedScrollingForFramesEnabled(
|
| ShouldUseCompositedScrollingForFrames(device_scale_factor_));
|
| + webview()->settings()->setCompositedSelectionUpdatesEnabled(
|
| + ShouldUseCompositedSelectionUpdates());
|
|
|
| ApplyWebPreferences(webkit_preferences_, webview());
|
|
|
| @@ -986,6 +1000,9 @@ void RenderViewImpl::PepperFocusChanged(PepperPluginInstanceImpl* instance,
|
| else if (focused_pepper_plugin_ == instance)
|
| focused_pepper_plugin_ = NULL;
|
|
|
| + if (compositor_)
|
| + compositor_->SetIgnoreSelectionUpdates(focused_pepper_plugin_ != NULL);
|
| +
|
| UpdateTextInputType();
|
| UpdateSelectionBounds();
|
| }
|
| @@ -3494,7 +3511,7 @@ ui::TextInputType RenderViewImpl::GetTextInputType() {
|
| return RenderWidget::GetTextInputType();
|
| }
|
|
|
| -void RenderViewImpl::GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) {
|
| +bool RenderViewImpl::GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) {
|
| #if defined(ENABLE_PLUGINS)
|
| if (focused_pepper_plugin_) {
|
| // TODO(kinaba) http://crbug.com/101101
|
| @@ -3504,10 +3521,15 @@ void RenderViewImpl::GetSelectionBounds(gfx::Rect* start, gfx::Rect* end) {
|
| gfx::Rect caret = focused_pepper_plugin_->GetCaretBounds();
|
| *start = caret;
|
| *end = caret;
|
| - return;
|
| + return true;
|
| }
|
| #endif
|
| - RenderWidget::GetSelectionBounds(start, end);
|
| +
|
| + if (compositor_ && webview() &&
|
| + webview()->settings()->compositedSelectionUpdatesEnabled())
|
| + return false;
|
| +
|
| + return RenderWidget::GetSelectionBounds(start, end);
|
| }
|
|
|
| #if defined(OS_MACOSX) || defined(USE_AURA)
|
|
|