diff options
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/render_view_impl.cc | 3 | ||||
-rw-r--r-- | content/renderer/render_view_impl.h | 7 | ||||
-rw-r--r-- | content/renderer/render_view_impl_android.cc | 13 |
3 files changed, 23 insertions, 0 deletions
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 19ddf5f..5c83fb3 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -767,6 +767,9 @@ RenderViewImpl::RenderViewImpl(RenderViewImplParams* params) target_url_status_(TARGET_NONE), selection_text_offset_(0), selection_range_(ui::Range::InvalidRange()), +#if defined(OS_ANDROID) + top_controls_constraints_(cc::BOTH), +#endif cached_is_main_frame_pinned_to_left_(false), cached_is_main_frame_pinned_to_right_(false), cached_has_main_frame_horizontal_scrollbar_(false), diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index ddd1283..08402a6 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -517,6 +517,7 @@ class CONTENT_EXPORT RenderViewImpl // date and time input fields using MULTIPLE_FIELDS_UI virtual bool openDateTimeChooser(const WebKit::WebDateTimeChooserParams&, WebKit::WebDateTimeChooserCompletion*); + virtual void didScrollWithKeyboard(const WebKit::WebSize& delta); #endif // WebKit::WebFrameClient implementation ------------------------------------- @@ -1358,6 +1359,12 @@ class CONTENT_EXPORT RenderViewImpl // much about leaks. IDMap<ContextMenuClient, IDMapExternalPointer> pending_context_menus_; +#if defined(OS_ANDROID) + // Cache the old top controls state constraints. Used when updating + // current value only without altering the constraints. + cc::TopControlsState top_controls_constraints_; +#endif + // View ---------------------------------------------------------------------- // Cache the preferred size of the page in order to prevent sending the IPC diff --git a/content/renderer/render_view_impl_android.cc b/content/renderer/render_view_impl_android.cc index 1742eac..5a05278 100644 --- a/content/renderer/render_view_impl_android.cc +++ b/content/renderer/render_view_impl_android.cc @@ -36,6 +36,7 @@ void RenderViewImpl::OnUpdateTopControlsState(bool enable_hiding, constraints = cc::SHOWN; cc::TopControlsState current = cc::BOTH; compositor_->UpdateTopControlsState(constraints, current, animate); + top_controls_constraints_ = constraints; } } @@ -47,6 +48,18 @@ void RenderViewImpl::UpdateTopControlsState(TopControlsState constraints, cc::TopControlsState current_cc = ContentToCcTopControlsState(current); if (compositor_) compositor_->UpdateTopControlsState(constraints_cc, current_cc, animate); + top_controls_constraints_ = constraints_cc; +} + +void RenderViewImpl::didScrollWithKeyboard(const WebKit::WebSize& delta) { + if (delta.height == 0) + return; + if (compositor_) { + cc::TopControlsState current = delta.height < 0 ? cc::SHOWN : cc::HIDDEN; + compositor_->UpdateTopControlsState(top_controls_constraints_, + current, + true); + } } } // namespace content |