Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: content/renderer/render_view_impl_android.cc

Issue 14139013: Hide location bar on Javascript-initiated scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync, merge, address style nits. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl_android.cc
diff --git a/content/renderer/render_view_impl_android.cc b/content/renderer/render_view_impl_android.cc
index 0d5ade1b3f222991ab68c706ac14ba4238996102..1742eac997e6e435d0e081e6aceac1349c27b0e9 100644
--- a/content/renderer/render_view_impl_android.cc
+++ b/content/renderer/render_view_impl_android.cc
@@ -11,14 +11,42 @@
namespace content {
+// Check content::TopControlsState and cc::TopControlsState are kept in sync.
+COMPILE_ASSERT(int(SHOWN) == int(cc::SHOWN), mismatching_enums);
+COMPILE_ASSERT(int(HIDDEN) == int(cc::HIDDEN), mismatching_enums);
+COMPILE_ASSERT(int(BOTH) == int(cc::BOTH), mismatching_enums);
+
+cc::TopControlsState ContentToCcTopControlsState(
+ TopControlsState state) {
+ return static_cast<cc::TopControlsState>(state);
+}
+
+// TODO(mvanouwerkerk): Stop calling this code path and delete it.
void RenderViewImpl::OnUpdateTopControlsState(bool enable_hiding,
bool enable_showing,
bool animate) {
// TODO(tedchoc): Investigate why messages are getting here before the
// compositor has been initialized.
LOG_IF(WARNING, !compositor_) << "OnUpdateTopControlsState was unhandled.";
+ if (compositor_) {
+ cc::TopControlsState constraints = cc::BOTH;
+ if (!enable_showing)
+ constraints = cc::HIDDEN;
+ if (!enable_hiding)
+ constraints = cc::SHOWN;
+ cc::TopControlsState current = cc::BOTH;
+ compositor_->UpdateTopControlsState(constraints, current, animate);
+ }
+}
+
+void RenderViewImpl::UpdateTopControlsState(TopControlsState constraints,
+ TopControlsState current,
+ bool animate) {
+ cc::TopControlsState constraints_cc =
+ ContentToCcTopControlsState(constraints);
+ cc::TopControlsState current_cc = ContentToCcTopControlsState(current);
if (compositor_)
- compositor_->UpdateTopControlsState(enable_hiding, enable_showing, animate);
+ compositor_->UpdateTopControlsState(constraints_cc, current_cc, animate);
}
} // namespace content
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698