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

Side by Side Diff: ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm

Issue 2869903002: [ios clean] Dismisses ToolsMenu on Layout changes. (Closed)
Patch Set: Uses viewWillTransitionToSize Created 3 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
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.h" 5 #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_view_controller.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h" 8 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_overlay_view.h"
9 #import "ios/clean/chrome/browser/ui/actions/settings_actions.h" 9 #import "ios/clean/chrome/browser/ui/actions/settings_actions.h"
10 #import "ios/clean/chrome/browser/ui/actions/tab_grid_actions.h" 10 #import "ios/clean/chrome/browser/ui/actions/tab_grid_actions.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 cr_frameForTabGridNewTabButtonInRect:self.view.bounds]]; 78 cr_frameForTabGridNewTabButtonInRect:self.view.bounds]];
79 [self.view addSubview:self.floatingNewTabButton]; 79 [self.view addSubview:self.floatingNewTabButton];
80 } 80 }
81 81
82 - (void)viewDidLayoutSubviews { 82 - (void)viewDidLayoutSubviews {
83 [super viewDidLayoutSubviews]; 83 [super viewDidLayoutSubviews];
84 self.tabs.contentInset = 84 self.tabs.contentInset =
85 UIEdgeInsetsMake(CGRectGetMaxY(self.toolbar.frame), 0, 0, 0); 85 UIEdgeInsetsMake(CGRectGetMaxY(self.toolbar.frame), 0, 0, 0);
86 } 86 }
87 87
88 - (void)viewWillTransitionToSize:(CGSize)size
89 withTransitionCoordinator:
90 (id<UIViewControllerTransitionCoordinator>)coordinator {
91 // We need to dismiss the ToolsMenu everytime the Toolbar frame changes
92 // (e.g. Size changes, rotation changes, etc.)
93 [self.dispatcher closeToolsMenu];
94 }
95
88 #pragma mark - SettingsActions 96 #pragma mark - SettingsActions
89 97
90 - (void)showSettings:(id)sender { 98 - (void)showSettings:(id)sender {
91 [self.dispatcher showSettings]; 99 [self.dispatcher showSettings];
92 } 100 }
93 101
94 #pragma mark - ToolsMenuActions 102 #pragma mark - ToolsMenuActions
95 103
96 - (void)showToolsMenu:(id)sender { 104 - (void)showToolsMenu:(id)sender {
97 [self.dispatcher showToolsMenu]; 105 [self.dispatcher showToolsMenu];
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 145 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
138 [self.tabs addSubview:overlayView]; 146 [self.tabs addSubview:overlayView];
139 self.noTabsOverlay = overlayView; 147 self.noTabsOverlay = overlayView;
140 } 148 }
141 149
142 - (void)removeNoTabsOverlay { 150 - (void)removeNoTabsOverlay {
143 [self.noTabsOverlay removeFromSuperview]; 151 [self.noTabsOverlay removeFromSuperview];
144 } 152 }
145 153
146 @end 154 @end
OLDNEW
« no previous file with comments | « no previous file | ios/clean/chrome/browser/ui/toolbar/toolbar_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698