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

Unified Diff: cc/input/top_controls_manager.cc

Issue 961023002: (Reland) Always create top controls manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed calculate_top_controls_position flag from Android flags Created 5 years, 10 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 | « cc/input/top_controls_manager.h ('k') | cc/input/top_controls_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/top_controls_manager.cc
diff --git a/cc/input/top_controls_manager.cc b/cc/input/top_controls_manager.cc
index 7362805de99acba4c5caa3145f9f268df1778336..bf0bf3fe4a05087f67c1e4fa2397abb6e04c5166 100644
--- a/cc/input/top_controls_manager.cc
+++ b/cc/input/top_controls_manager.cc
@@ -69,6 +69,9 @@ float TopControlsManager::TopControlsHeight() const {
void TopControlsManager::UpdateTopControlsState(TopControlsState constraints,
TopControlsState current,
bool animate) {
+ if (!TopControlsEnabled())
aelias_OOO_until_Jul13 2015/03/04 20:05:53 This one shouldn't be suppressed by height. We sh
bokan 2015/03/04 21:48:30 Done.
+ return;
+
DCHECK(!(constraints == SHOWN && current == HIDDEN));
DCHECK(!(constraints == HIDDEN && current == SHOWN));
@@ -94,6 +97,9 @@ void TopControlsManager::UpdateTopControlsState(TopControlsState constraints,
}
void TopControlsManager::ScrollBegin() {
+ if (!TopControlsEnabled())
aelias_OOO_until_Jul13 2015/03/04 20:05:53 I think we should remove all of the extra early-re
bokan 2015/03/04 21:48:30 Done.
+ return;
+
DCHECK(!pinch_gesture_active_);
ResetAnimations();
ResetBaseline();
@@ -101,6 +107,9 @@ void TopControlsManager::ScrollBegin() {
gfx::Vector2dF TopControlsManager::ScrollBy(
const gfx::Vector2dF& pending_delta) {
+ if (!TopControlsEnabled())
+ return pending_delta;
+
if (pinch_gesture_active_)
return pending_delta;
@@ -128,17 +137,26 @@ gfx::Vector2dF TopControlsManager::ScrollBy(
}
void TopControlsManager::ScrollEnd() {
+ if (!TopControlsEnabled())
+ return;
+
DCHECK(!pinch_gesture_active_);
StartAnimationIfNecessary();
}
void TopControlsManager::PinchBegin() {
+ if (!TopControlsEnabled())
+ return;
+
DCHECK(!pinch_gesture_active_);
pinch_gesture_active_ = true;
StartAnimationIfNecessary();
}
void TopControlsManager::PinchEnd() {
+ if (!TopControlsEnabled())
+ return;
+
DCHECK(pinch_gesture_active_);
// Pinch{Begin,End} will always occur within the scope of Scroll{Begin,End},
// so return to a state expected by the remaining scroll sequence.
@@ -147,10 +165,15 @@ void TopControlsManager::PinchEnd() {
}
void TopControlsManager::MainThreadHasStoppedFlinging() {
+ if (!TopControlsEnabled())
+ return;
+
StartAnimationIfNecessary();
}
gfx::Vector2dF TopControlsManager::Animate(base::TimeTicks monotonic_time) {
+ DCHECK(TopControlsEnabled());
aelias_OOO_until_Jul13 2015/03/04 20:05:53 I'd suggest removing this DCHECK. If you're worri
bokan 2015/03/04 21:48:30 Done.
+
if (!top_controls_animation_ || !client_->HaveRootScrollLayer())
return gfx::Vector2dF();
@@ -231,4 +254,8 @@ void TopControlsManager::ResetBaseline() {
baseline_content_offset_ = ContentTopOffset();
}
+bool TopControlsManager::TopControlsEnabled() {
aelias_OOO_until_Jul13 2015/03/04 20:05:53 I don't think we should have a method called this,
bokan 2015/03/04 21:48:30 Done.
+ return TopControlsHeight();
+}
+
} // namespace cc
« no previous file with comments | « cc/input/top_controls_manager.h ('k') | cc/input/top_controls_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698