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

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: 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
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)viewWillLayoutSubviews {
89 // We need to dismiss the ToolsMenu everytime the Toolbar position changes
90 // (e.g. Size changes, rotation changes, etc.)
marq (ping after 24h) 2017/05/09 12:13:26 This is probably fine, but note that the condition
sczs 2017/05/10 02:25:46 Yes, you're right! I was stating what are we tryin
91 [self.dispatcher closeToolsMenu];
92 }
93
88 #pragma mark - SettingsActions 94 #pragma mark - SettingsActions
89 95
90 - (void)showSettings:(id)sender { 96 - (void)showSettings:(id)sender {
91 [self.dispatcher showSettings]; 97 [self.dispatcher showSettings];
92 } 98 }
93 99
94 #pragma mark - ToolsMenuActions 100 #pragma mark - ToolsMenuActions
95 101
96 - (void)showToolsMenu:(id)sender { 102 - (void)showToolsMenu:(id)sender {
97 [self.dispatcher showToolsMenu]; 103 [self.dispatcher showToolsMenu];
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; 143 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
138 [self.tabs addSubview:overlayView]; 144 [self.tabs addSubview:overlayView];
139 self.noTabsOverlay = overlayView; 145 self.noTabsOverlay = overlayView;
140 } 146 }
141 147
142 - (void)removeNoTabsOverlay { 148 - (void)removeNoTabsOverlay {
143 [self.noTabsOverlay removeFromSuperview]; 149 [self.noTabsOverlay removeFromSuperview];
144 } 150 }
145 151
146 @end 152 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698