Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #import "ios/chrome/browser/ui/fullscreen_controller.h" | 5 #import "ios/chrome/browser/ui/fullscreen_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/objc_property_releaser.h" | 10 #include "base/mac/objc_property_releaser.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 // events triggered by the keyboard appearing to go through. | 137 // events triggered by the keyboard appearing to go through. |
| 138 - (void)keyboardStart:(NSNotification*)notification; | 138 - (void)keyboardStart:(NSNotification*)notification; |
| 139 - (void)keyboardEnd:(NSNotification*)notification; | 139 - (void)keyboardEnd:(NSNotification*)notification; |
| 140 // Called before and after an action that disables full screen. The version | 140 // Called before and after an action that disables full screen. The version |
| 141 // resetting the timer will ensure that the header stay on screen for a little | 141 // resetting the timer will ensure that the header stay on screen for a little |
| 142 // while. | 142 // while. |
| 143 - (void)incrementFullScreenLock; | 143 - (void)incrementFullScreenLock; |
| 144 - (void)decrementFullScreenLock; | 144 - (void)decrementFullScreenLock; |
| 145 // Called when the application is about to be the foreground application. | 145 // Called when the application is about to be the foreground application. |
| 146 - (void)applicationWillEnterForeground:(NSNotification*)notification; | 146 - (void)applicationWillEnterForeground:(NSNotification*)notification; |
| 147 // TODO(shreyasv): Make the following methods act on a WebViewScrollView proxy | |
| 148 // instead of taking in a UIScrollView directly. | |
| 149 // Called from -webViewScrollViewDidScroll: Returns YES if the scroll should be | 147 // Called from -webViewScrollViewDidScroll: Returns YES if the scroll should be |
| 150 // ignored. | 148 // ignored. |
| 151 - (BOOL)shouldIgnoreScroll:(CRWWebViewScrollViewProxy*)webViewScrollViewProxy; | 149 - (BOOL)shouldIgnoreScroll:(CRWWebViewScrollViewProxy*)webViewScrollViewProxy; |
| 152 // Processes a scroll event triggered by a user action. | 150 // Processes a scroll event triggered by a user action. |
| 153 - (void)userTriggeredWebViewScrollViewDidScroll: | 151 - (void)userTriggeredWebViewScrollViewDidScroll: |
| 154 (CRWWebViewScrollViewProxy*)webViewScrollViewProxy; | 152 (CRWWebViewScrollViewProxy*)webViewScrollViewProxy; |
| 155 // Processes a scroll event triggered by code (these could be initiated via | 153 // Processes a scroll event triggered by code (these could be initiated via |
| 156 // Javascript, find in page or simply the keyboard sliding in and out). | 154 // Javascript, find in page or simply the keyboard sliding in and out). |
| 157 - (void)codeTriggeredWebViewScrollViewDidScroll: | 155 - (void)codeTriggeredWebViewScrollViewDidScroll: |
| 158 (CRWWebViewScrollViewProxy*)webViewScrollViewProxy; | 156 (CRWWebViewScrollViewProxy*)webViewScrollViewProxy; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 name:kTabStripDragEnded | 285 name:kTabStripDragEnded |
| 288 object:nil]; | 286 object:nil]; |
| 289 [center addObserver:self | 287 [center addObserver:self |
| 290 selector:@selector(incrementFullScreenLock) | 288 selector:@selector(incrementFullScreenLock) |
| 291 name:ios_internal::kSideSwipeWillStartNotification | 289 name:ios_internal::kSideSwipeWillStartNotification |
| 292 object:nil]; | 290 object:nil]; |
| 293 [center addObserver:self | 291 [center addObserver:self |
| 294 selector:@selector(decrementFullScreenLock) | 292 selector:@selector(decrementFullScreenLock) |
| 295 name:ios_internal::kSideSwipeDidStopNotification | 293 name:ios_internal::kSideSwipeDidStopNotification |
| 296 object:nil]; | 294 object:nil]; |
| 297 // TODO(jbbegue): Evaluate using a listener instead of a notification | 295 // TODO(crbug.com/451373): Evaluate using listener instead of notifications. |
|
rohitrao (ping after 24h)
2017/01/10 17:24:02
"Listeners"?
| |
| 298 // crbug/451373. | |
| 299 [center addObserver:self | 296 [center addObserver:self |
| 300 selector:@selector(overscrollActionsWillStart) | 297 selector:@selector(overscrollActionsWillStart) |
| 301 name:kOverscrollActionsWillStart | 298 name:kOverscrollActionsWillStart |
| 302 object:nil]; | 299 object:nil]; |
| 303 [center addObserver:self | 300 [center addObserver:self |
| 304 selector:@selector(overscrollActionsDidEnd) | 301 selector:@selector(overscrollActionsDidEnd) |
| 305 name:kOverscrollActionsDidEnd | 302 name:kOverscrollActionsDidEnd |
| 306 object:nil]; | 303 object:nil]; |
| 307 [self moveHeaderToRestingPosition:YES]; | 304 [self moveHeaderToRestingPosition:YES]; |
| 308 } | 305 } |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 819 overscrollActionsInProgress_ = NO; | 816 overscrollActionsInProgress_ = NO; |
| 820 } | 817 } |
| 821 | 818 |
| 822 #pragma mark - Used for testing | 819 #pragma mark - Used for testing |
| 823 | 820 |
| 824 + (void)setEnabledForTests:(BOOL)enabled { | 821 + (void)setEnabledForTests:(BOOL)enabled { |
| 825 gEnabledForTests = enabled; | 822 gEnabledForTests = enabled; |
| 826 } | 823 } |
| 827 | 824 |
| 828 @end | 825 @end |
| OLD | NEW |