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

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm

Issue 2933963002: [ios] Fix omnibox baseWritingDirection and dismissal iOS11 bugs. (Closed)
Patch Set: more omnibox fixes Created 3 years, 6 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
Index: ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm
index 1493aa7d09d04cbc5e3acf0a93cc67ec603b3f07..a63c98ae2c3be1143e20f8873a38092d46032b6f 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_view_controller.mm
@@ -564,20 +564,23 @@ initWithPopupView:(OmniboxPopupViewIOS*)view
size_t size = _currentResult.size();
[self.tableView reloadData];
rohitrao (ping after 24h) 2017/06/14 14:54:11 I don't understand this code at all. Why do we ne
justincohen 2017/06/14 16:44:08 material design! we lay out the rows ourselves be
- [self.tableView beginUpdates];
- for (size_t i = 0; i < kRowCount; i++) {
- OmniboxPopupMaterialRow* row = _rows[i];
- if (i < size) {
- const AutocompleteMatch& match =
- ((const AutocompleteResult&)_currentResult).match_at((NSUInteger)i);
- [self updateRow:row withMatch:match];
- row.hidden = NO;
- } else {
- row.hidden = YES;
+ [UIView performWithoutAnimation:^{
rohitrao (ping after 24h) 2017/06/14 14:54:11 Please add a comment explaining what's going on he
justincohen 2017/06/14 16:44:08 Done.
+ [self.tableView beginUpdates];
+ for (size_t i = 0; i < kRowCount; i++) {
+ OmniboxPopupMaterialRow* row = _rows[i];
+
+ if (i < size) {
+ const AutocompleteMatch& match =
+ ((const AutocompleteResult&)_currentResult).match_at((NSUInteger)i);
+ [self updateRow:row withMatch:match];
+ row.hidden = NO;
+ } else {
+ row.hidden = YES;
+ }
}
- }
- [self.tableView endUpdates];
+ [self.tableView endUpdates];
+ }];
if (IsIPadIdiom())
[self updateContentInsetForKeyboard];
@@ -656,10 +659,7 @@ initWithPopupView:(OmniboxPopupViewIOS*)view
#pragma mark UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView*)scrollView {
- // Setting the top inset of the scrollView to |kTopAndBottomPadding| causes a
- // one time scrollViewDidScroll to |-kTopAndBottomPadding|. It's easier to
- // just ignore this one scroll tick.
- if (scrollView.contentOffset.y == 0 - kTopAndBottomPadding)
+ if (!scrollView.dragging)
rohitrao (ping after 24h) 2017/06/14 14:54:11 Nice, this feels much cleaner.
justincohen 2017/06/14 16:44:08 good, not planning on putting this or above behind
return;
_popupView->DidScroll();

Powered by Google App Engine
This is Rietveld 408576698