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

Side by Side Diff: cc/input/top_controls_manager.cc

Issue 11967015: Hide location bar on WebKit programmatic scroll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/input/top_controls_manager.h" 5 #include "cc/input/top_controls_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 if (!enable) { 61 if (!enable) {
62 ResetAnimations(); 62 ResetAnimations();
63 if (controls_top_offset_ != 0) { 63 if (controls_top_offset_ != 0) {
64 SetupAnimation(SHOWING_CONTROLS); 64 SetupAnimation(SHOWING_CONTROLS);
65 client_->setNeedsRedraw(); 65 client_->setNeedsRedraw();
66 } 66 }
67 } 67 }
68 } 68 }
69 69
70 void TopControlsManager::ShowTopControls(bool show) {
71 if (show) {
72 if (controls_top_offset_ == 0)
aelias_OOO_until_Jul13 2013/03/25 22:35:44 Please add these two early outs to SetupAnimation
John Knottenbelt 2013/03/26 14:49:17 Done.
73 return;
74 SetupAnimation(SHOWING_CONTROLS);
75 } else {
76 DCHECK(enable_hiding_);
77 if (controls_top_offset_ == -top_controls_height_)
78 return;
79 SetupAnimation(HIDING_CONTROLS);
80 }
aelias_OOO_until_Jul13 2013/03/25 22:35:44 Looks like you're missing a client_->setNeedsRedra
John Knottenbelt 2013/03/26 14:49:17 Done.
81 }
82
70 void TopControlsManager::ScrollBegin() { 83 void TopControlsManager::ScrollBegin() {
71 ResetAnimations(); 84 ResetAnimations();
72 current_scroll_delta_ = 0.f; 85 current_scroll_delta_ = 0.f;
73 controls_scroll_begin_offset_ = controls_top_offset_; 86 controls_scroll_begin_offset_ = controls_top_offset_;
74 } 87 }
75 88
76 gfx::Vector2dF TopControlsManager::ScrollBy( 89 gfx::Vector2dF TopControlsManager::ScrollBy(
77 const gfx::Vector2dF pending_delta) { 90 const gfx::Vector2dF pending_delta) {
78 if (!enable_hiding_ && pending_delta.y() > 0) 91 if (!enable_hiding_ && pending_delta.y() > 0)
79 return pending_delta; 92 return pending_delta;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 201
189 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) || 202 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
190 (animation_direction_ == HIDING_CONTROLS 203 (animation_direction_ == HIDING_CONTROLS
191 && new_offset <= -top_controls_height_)) { 204 && new_offset <= -top_controls_height_)) {
192 return true; 205 return true;
193 } 206 }
194 return false; 207 return false;
195 } 208 }
196 209
197 } // namespace cc 210 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698