| 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/settings/settings_navigation_controller.h" | 5 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" |
| 6 | 6 |
| 7 #include "base/ios/ios_util.h" | 7 #include "base/ios/ios_util.h" |
| 8 #import "base/ios/weak_nsobject.h" | 8 #import "base/ios/weak_nsobject.h" |
| 9 #include "base/mac/foundation_util.h" | 9 #include "base/mac/foundation_util.h" |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 NOTREACHED() | 535 NOTREACHED() |
| 536 << "Unexpected command " << [sender tag] | 536 << "Unexpected command " << [sender tag] |
| 537 << " Settings commands must execute on the main browser state."; | 537 << " Settings commands must execute on the main browser state."; |
| 538 } | 538 } |
| 539 [[self nextResponder] chromeExecuteCommand:sender]; | 539 [[self nextResponder] chromeExecuteCommand:sender]; |
| 540 } | 540 } |
| 541 | 541 |
| 542 #pragma mark - UIResponder | 542 #pragma mark - UIResponder |
| 543 | 543 |
| 544 - (NSArray*)keyCommands { | 544 - (NSArray*)keyCommands { |
| 545 if ([self presentedViewController]) { |
| 546 return nil; |
| 547 } |
| 545 base::WeakNSObject<SettingsNavigationController> weakSelf(self); | 548 base::WeakNSObject<SettingsNavigationController> weakSelf(self); |
| 546 return @[ | 549 return @[ |
| 547 [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape | 550 [UIKeyCommand cr_keyCommandWithInput:UIKeyInputEscape |
| 548 modifierFlags:Cr_UIKeyModifierNone | 551 modifierFlags:Cr_UIKeyModifierNone |
| 549 title:nil | 552 title:nil |
| 550 action:^{ | 553 action:^{ |
| 551 [weakSelf closeSettings]; | 554 [weakSelf closeSettings]; |
| 552 }], | 555 }], |
| 553 ]; | 556 ]; |
| 554 } | 557 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 return [NSValue valueWithPointer:controller]; | 659 return [NSValue valueWithPointer:controller]; |
| 657 } | 660 } |
| 658 | 661 |
| 659 #pragma mark - UIResponder | 662 #pragma mark - UIResponder |
| 660 | 663 |
| 661 - (BOOL)canBecomeFirstResponder { | 664 - (BOOL)canBecomeFirstResponder { |
| 662 return YES; | 665 return YES; |
| 663 } | 666 } |
| 664 | 667 |
| 665 @end | 668 @end |
| OLD | NEW |