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

Side by Side Diff: ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.mm

Issue 2785893003: [ios clean] Add placeholder for NTP bookmarks, chrome home and open tabs. (Closed)
Patch Set: Comment nit Created 3 years, 8 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/chrome/browser/ui/ntp/new_tab_page_view.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ntp/new_tab_page_toolbar_controller.h" 5 #import "ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/metrics/user_metrics.h" 9 #include "base/metrics/user_metrics.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 base::scoped_nsobject<GenericChromeCommand> command( 199 base::scoped_nsobject<GenericChromeCommand> command(
200 [[GenericChromeCommand alloc] initWithTag:IDC_SHOW_FORWARD_HISTORY]); 200 [[GenericChromeCommand alloc] initWithTag:IDC_SHOW_FORWARD_HISTORY]);
201 [_forwardButton chromeExecuteCommand:command]; 201 [_forwardButton chromeExecuteCommand:command];
202 } 202 }
203 } 203 }
204 204
205 - (void)hideViewsForNewTabPage:(BOOL)hide { 205 - (void)hideViewsForNewTabPage:(BOOL)hide {
206 [super hideViewsForNewTabPage:hide]; 206 [super hideViewsForNewTabPage:hide];
207 // Show the back/forward buttons if there is forward history. 207 // Show the back/forward buttons if there is forward history.
208 ToolbarModelIOS* toolbarModelIOS = [_delegate toolbarModelIOS]; 208 ToolbarModelIOS* toolbarModelIOS = [_delegate toolbarModelIOS];
209 BOOL forwardEnabled = toolbarModelIOS->CanGoForward(); 209 if (toolbarModelIOS) {
210 [_backButton setHidden:!forwardEnabled && hide]; 210 BOOL forwardEnabled = toolbarModelIOS->CanGoForward();
211 [_backButton setEnabled:toolbarModelIOS->CanGoBack()]; 211 [_backButton setHidden:!forwardEnabled && hide];
212 [_forwardButton setHidden:!forwardEnabled && hide]; 212 [_backButton setEnabled:toolbarModelIOS->CanGoBack()];
213 [_forwardButton setHidden:!forwardEnabled && hide];
214 }
213 } 215 }
214 216
215 - (void)focusOmnibox:(id)sender { 217 - (void)focusOmnibox:(id)sender {
216 [_focuser focusFakebox]; 218 [_focuser focusFakebox];
217 } 219 }
218 220
219 - (IBAction)stackButtonTouchDown:(id)sender { 221 - (IBAction)stackButtonTouchDown:(id)sender {
220 [_delegate prepareToEnterTabSwitcher:self]; 222 [_delegate prepareToEnterTabSwitcher:self];
221 } 223 }
222 224
223 @end 225 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/ntp/new_tab_page_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698