OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/google_landing_view_controller.h" | 5 #import "ios/chrome/browser/ui/ntp/google_landing_view_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
12 #include "components/strings/grit/components_strings.h" | 12 #include "components/strings/grit/components_strings.h" |
13 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" | 13 #import "ios/chrome/browser/ui/commands/UIKit+ChromeExecuteCommand.h" |
| 14 #import "ios/chrome/browser/ui/commands/browser_commands.h" |
14 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" | 15 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h" |
15 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" | 16 #include "ios/chrome/browser/ui/commands/ios_command_ids.h" |
16 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collectio
n_utils.h" | 17 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collectio
n_utils.h" |
17 #import "ios/chrome/browser/ui/context_menu/context_menu_coordinator.h" | 18 #import "ios/chrome/browser/ui/context_menu/context_menu_coordinator.h" |
18 #import "ios/chrome/browser/ui/ntp/google_landing_data_source.h" | 19 #import "ios/chrome/browser/ui/ntp/google_landing_data_source.h" |
19 #import "ios/chrome/browser/ui/ntp/most_visited_cell.h" | 20 #import "ios/chrome/browser/ui/ntp/most_visited_cell.h" |
20 #import "ios/chrome/browser/ui/ntp/most_visited_layout.h" | 21 #import "ios/chrome/browser/ui/ntp/most_visited_layout.h" |
21 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" | 22 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h" |
22 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_view.h" | 23 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_view.h" |
23 #import "ios/chrome/browser/ui/ntp/whats_new_header_view.h" | 24 #import "ios/chrome/browser/ui/ntp/whats_new_header_view.h" |
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 | 1242 |
1242 - (void)overscrollActionsController:(OverscrollActionsController*)controller | 1243 - (void)overscrollActionsController:(OverscrollActionsController*)controller |
1243 didTriggerAction:(OverscrollAction)action { | 1244 didTriggerAction:(OverscrollAction)action { |
1244 switch (action) { | 1245 switch (action) { |
1245 case OverscrollAction::NEW_TAB: { | 1246 case OverscrollAction::NEW_TAB: { |
1246 base::scoped_nsobject<GenericChromeCommand> command( | 1247 base::scoped_nsobject<GenericChromeCommand> command( |
1247 [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]); | 1248 [[GenericChromeCommand alloc] initWithTag:IDC_NEW_TAB]); |
1248 [[self view] chromeExecuteCommand:command]; | 1249 [[self view] chromeExecuteCommand:command]; |
1249 } break; | 1250 } break; |
1250 case OverscrollAction::CLOSE_TAB: { | 1251 case OverscrollAction::CLOSE_TAB: { |
1251 base::scoped_nsobject<GenericChromeCommand> command( | 1252 [self.dispatcher closeCurrentTab]; |
1252 [[GenericChromeCommand alloc] initWithTag:IDC_CLOSE_TAB]); | |
1253 [[self view] chromeExecuteCommand:command]; | |
1254 } break; | 1253 } break; |
1255 case OverscrollAction::REFRESH: | 1254 case OverscrollAction::REFRESH: |
1256 [self reload]; | 1255 [self reload]; |
1257 break; | 1256 break; |
1258 case OverscrollAction::NONE: | 1257 case OverscrollAction::NONE: |
1259 NOTREACHED(); | 1258 NOTREACHED(); |
1260 break; | 1259 break; |
1261 } | 1260 } |
1262 } | 1261 } |
1263 | 1262 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 - (void)setCanGoForward:(BOOL)canGoForward { | 1327 - (void)setCanGoForward:(BOOL)canGoForward { |
1329 _canGoForward = canGoForward; | 1328 _canGoForward = canGoForward; |
1330 [_headerView setCanGoForward:self.canGoForward]; | 1329 [_headerView setCanGoForward:self.canGoForward]; |
1331 } | 1330 } |
1332 | 1331 |
1333 - (void)setCanGoBack:(BOOL)canGoBack { | 1332 - (void)setCanGoBack:(BOOL)canGoBack { |
1334 _canGoBack = canGoBack; | 1333 _canGoBack = canGoBack; |
1335 [_headerView setCanGoBack:self.canGoBack]; | 1334 [_headerView setCanGoBack:self.canGoBack]; |
1336 } | 1335 } |
1337 @end | 1336 @end |
OLD | NEW |