Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/overscroll_actions/overscroll_actions_controller. h" | 5 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller. h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 512 [_webViewScrollViewProxy removeObserver:self]; | 512 [_webViewScrollViewProxy removeObserver:self]; |
| 513 _webViewScrollViewProxy.reset([[webViewProxy scrollViewProxy] retain]); | 513 _webViewScrollViewProxy.reset([[webViewProxy scrollViewProxy] retain]); |
| 514 [_webViewScrollViewProxy addObserver:self]; | 514 [_webViewScrollViewProxy addObserver:self]; |
| 515 [self enableOverscrollActions]; | 515 [self enableOverscrollActions]; |
| 516 } | 516 } |
| 517 | 517 |
| 518 - (void)webControllerWillClose:(CRWWebController*)webController { | 518 - (void)webControllerWillClose:(CRWWebController*)webController { |
| 519 [self disableOverscrollActions]; | 519 [self disableOverscrollActions]; |
| 520 [_webViewScrollViewProxy removeObserver:self]; | 520 [_webViewScrollViewProxy removeObserver:self]; |
| 521 _webViewScrollViewProxy.reset(); | 521 _webViewScrollViewProxy.reset(); |
| 522 [webController removeObserver:self]; | |
|
rohitrao (ping after 24h)
2017/03/26 23:21:22
Do we not need to remove webcontroller observers a
sdefresne
2017/03/28 15:15:05
This is done in Tab -onWebStateDestroyed:.
| |
| 523 } | 522 } |
| 524 | 523 |
| 525 #pragma mark - Private | 524 #pragma mark - Private |
| 526 | 525 |
| 527 - (void)recordMetricForTriggeredAction:(OverscrollAction)action { | 526 - (void)recordMetricForTriggeredAction:(OverscrollAction)action { |
| 528 switch (action) { | 527 switch (action) { |
| 529 case OverscrollAction::NONE: | 528 case OverscrollAction::NONE: |
| 530 UMA_HISTOGRAM_ENUMERATION(kOverscrollActionsHistogram, | 529 UMA_HISTOGRAM_ENUMERATION(kOverscrollActionsHistogram, |
| 531 OVERSCROLL_ACTION_CANCELED, | 530 OVERSCROLL_ACTION_CANCELED, |
| 532 OVERSCROLL_ACTION_COUNT); | 531 OVERSCROLL_ACTION_COUNT); |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 902 overscrollActionsController:self | 901 overscrollActionsController:self |
| 903 didTriggerAction:self.overscrollActionView.selectedAction]; | 902 didTriggerAction:self.overscrollActionView.selectedAction]; |
| 904 } | 903 } |
| 905 | 904 |
| 906 - (void)overscrollActionsView:(OverscrollActionsView*)view | 905 - (void)overscrollActionsView:(OverscrollActionsView*)view |
| 907 selectedActionDidChange:(OverscrollAction)newAction { | 906 selectedActionDidChange:(OverscrollAction)newAction { |
| 908 TriggerHapticFeedbackForSelectionChange(); | 907 TriggerHapticFeedbackForSelectionChange(); |
| 909 } | 908 } |
| 910 | 909 |
| 911 @end | 910 @end |
| OLD | NEW |