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

Side by Side Diff: ios/chrome/browser/ui/history/history_panel_view_controller.mm

Issue 2718683002: Let modal view controllers become first responder when presented. (Closed)
Patch Set: Created 3 years, 9 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/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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698