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

Side by Side Diff: ios/chrome/browser/ui/side_swipe/side_swipe_controller.mm

Issue 2599313002: Create headerHeightForTab in TabHeadersDelegate. (Closed)
Patch Set: only fullscreencontroller and sideswipecontroller Created 3 years, 11 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 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/side_swipe/side_swipe_controller.h" 5 #import "ios/chrome/browser/ui/side_swipe/side_swipe_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "components/reading_list/core/reading_list_switches.h" 9 #include "components/reading_list/core/reading_list_switches.h"
10 #import "components/reading_list/ios/reading_list_model.h" 10 #import "components/reading_list/ios/reading_list_model.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 [[model_ currentTab] updateFullscreenWithToolbarVisible:YES]; 384 [[model_ currentTab] updateFullscreenWithToolbarVisible:YES];
385 385
386 inSwipe_ = YES; 386 inSwipe_ = YES;
387 [swipeDelegate_ updateAccessoryViewsForSideSwipeWithVisibility:NO]; 387 [swipeDelegate_ updateAccessoryViewsForSideSwipeWithVisibility:NO];
388 BOOL goBack = IsSwipingBack(gesture.direction); 388 BOOL goBack = IsSwipingBack(gesture.direction);
389 389
390 currentContentProvider_.reset([self contentProviderForGesture:goBack]); 390 currentContentProvider_.reset([self contentProviderForGesture:goBack]);
391 BOOL canNavigate = currentContentProvider_ != nil; 391 BOOL canNavigate = currentContentProvider_ != nil;
392 392
393 CGRect gestureBounds = gesture.view.bounds; 393 CGRect gestureBounds = gesture.view.bounds;
394 CGFloat headerHeight = [swipeDelegate_ headerHeight]; 394 CGFloat headerHeight = [swipeDelegate_ headerHeightForCurrentTab];
395 CGRect navigationFrame = 395 CGRect navigationFrame =
396 CGRectMake(CGRectGetMinX(gestureBounds), 396 CGRectMake(CGRectGetMinX(gestureBounds),
397 CGRectGetMinY(gestureBounds) + headerHeight, 397 CGRectGetMinY(gestureBounds) + headerHeight,
398 CGRectGetWidth(gestureBounds), 398 CGRectGetWidth(gestureBounds),
399 CGRectGetHeight(gestureBounds) - headerHeight); 399 CGRectGetHeight(gestureBounds) - headerHeight);
400 400
401 pageSideSwipeView_.reset([[SideSwipeNavigationView alloc] 401 pageSideSwipeView_.reset([[SideSwipeNavigationView alloc]
402 initWithFrame:navigationFrame 402 initWithFrame:navigationFrame
403 withDirection:gesture.direction 403 withDirection:gesture.direction
404 canNavigate:canNavigate 404 canNavigate:canNavigate
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 didChangeActiveTab:(Tab*)newTab 534 didChangeActiveTab:(Tab*)newTab
535 previousTab:(Tab*)previousTab 535 previousTab:(Tab*)previousTab
536 atIndex:(NSUInteger)index { 536 atIndex:(NSUInteger)index {
537 // Toggling the gesture's enabled state off and on will effectively cancel 537 // Toggling the gesture's enabled state off and on will effectively cancel
538 // the gesture recognizer. 538 // the gesture recognizer.
539 [swipeGestureRecognizer_ setEnabled:NO]; 539 [swipeGestureRecognizer_ setEnabled:NO];
540 [swipeGestureRecognizer_ setEnabled:YES]; 540 [swipeGestureRecognizer_ setEnabled:YES];
541 } 541 }
542 542
543 @end 543 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698