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

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

Issue 14999010: Allows fullscreen to be triggered with the key events used for scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments 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 unified diff | Download patch
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 top_controls_show_height_( 48 top_controls_show_height_(
49 top_controls_height * top_controls_hide_threshold), 49 top_controls_height * top_controls_hide_threshold),
50 top_controls_hide_height_( 50 top_controls_hide_height_(
51 top_controls_height * (1.f - top_controls_show_threshold)) { 51 top_controls_height * (1.f - top_controls_show_threshold)) {
52 CHECK(client_); 52 CHECK(client_);
53 } 53 }
54 54
55 TopControlsManager::~TopControlsManager() { 55 TopControlsManager::~TopControlsManager() {
56 } 56 }
57 57
58 void TopControlsManager::UpdateTopControlsStatePreservingConstraints(
59 TopControlsState current,
60 bool animate) {
61 UpdateTopControlsState(permitted_state_, current, animate);
62 }
63
58 void TopControlsManager::UpdateTopControlsState(TopControlsState constraints, 64 void TopControlsManager::UpdateTopControlsState(TopControlsState constraints,
59 TopControlsState current, 65 TopControlsState current,
60 bool animate) { 66 bool animate) {
61 DCHECK(!(constraints == SHOWN && current == HIDDEN)); 67 DCHECK(!(constraints == SHOWN && current == HIDDEN));
62 DCHECK(!(constraints == HIDDEN && current == SHOWN)); 68 DCHECK(!(constraints == HIDDEN && current == SHOWN));
63 69
64 permitted_state_ = constraints; 70 permitted_state_ = constraints;
65 71
66 // Don't do anything if it doesn't matter which state the controls are in. 72 // Don't do anything if it doesn't matter which state the controls are in.
67 if (constraints == BOTH && current == BOTH) 73 if (constraints == BOTH && current == BOTH)
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 227
222 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) || 228 if ((animation_direction_ == SHOWING_CONTROLS && new_offset >= 0) ||
223 (animation_direction_ == HIDING_CONTROLS 229 (animation_direction_ == HIDING_CONTROLS
224 && new_offset <= -top_controls_height_)) { 230 && new_offset <= -top_controls_height_)) {
225 return true; 231 return true;
226 } 232 }
227 return false; 233 return false;
228 } 234 }
229 235
230 } // namespace cc 236 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698