| OLD | NEW |
| 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/chrome/browser/ui/history/history_panel_view_controller.h" | 5 #import "ios/chrome/browser/ui/history/history_panel_view_controller.h" |
| 6 | 6 |
| 7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
| 8 #include "base/ios/ios_util.h" | 8 #include "base/ios/ios_util.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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 - (void)configureClearBrowsingBar { | 402 - (void)configureClearBrowsingBar { |
| 403 _clearBrowsingBar.editing = _historyCollectionController.editing; | 403 _clearBrowsingBar.editing = _historyCollectionController.editing; |
| 404 _clearBrowsingBar.deleteButtonEnabled = | 404 _clearBrowsingBar.deleteButtonEnabled = |
| 405 [_historyCollectionController hasSelectedEntries]; | 405 [_historyCollectionController hasSelectedEntries]; |
| 406 _clearBrowsingBar.editButtonEnabled = | 406 _clearBrowsingBar.editButtonEnabled = |
| 407 [_historyCollectionController hasHistoryEntries]; | 407 [_historyCollectionController hasHistoryEntries]; |
| 408 } | 408 } |
| 409 | 409 |
| 410 #pragma mark - UIResponder | 410 #pragma mark - UIResponder |
| 411 | 411 |
| 412 - (BOOL)canBecomeFirstResponder { |
| 413 return YES; |
| 414 } |
| 415 |
| 412 - (NSArray*)keyCommands { | 416 - (NSArray*)keyCommands { |
| 413 __weak HistoryPanelViewController* weakSelf = self; | 417 __weak HistoryPanelViewController* weakSelf = self; |
| 414 return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape | 418 return @[ [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape |
| 415 modifierFlags:Cr_UIKeyModifierNone | 419 modifierFlags:Cr_UIKeyModifierNone |
| 416 title:nil | 420 title:nil |
| 417 action:^{ | 421 action:^{ |
| 418 [weakSelf closeHistory]; | 422 [weakSelf closeHistory]; |
| 419 }] ]; | 423 }] ]; |
| 420 } | 424 } |
| 421 | 425 |
| 422 @end | 426 @end |
| OLD | NEW |