Chromium Code Reviews| 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]) { | |
|
gambard
2017/02/24 12:33:28
Are you sure this is reset to nil when the present
lpromero
2017/02/27 16:55:52
Done. (Yes the property is correctly updated.)
| |
| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 NSValue* key = [self keyForController:controller]; | 653 NSValue* key = [self keyForController:controller]; |
| 651 return [appBarContainedViewControllers_ objectForKey:key]; | 654 return [appBarContainedViewControllers_ objectForKey:key]; |
| 652 } | 655 } |
| 653 | 656 |
| 654 // Returns the dictionary key to use when dealing with |controller|. | 657 // Returns the dictionary key to use when dealing with |controller|. |
| 655 - (NSValue*)keyForController:(UIViewController*)controller { | 658 - (NSValue*)keyForController:(UIViewController*)controller { |
| 656 return [NSValue valueWithPointer:controller]; | 659 return [NSValue valueWithPointer:controller]; |
| 657 } | 660 } |
| 658 | 661 |
| 659 @end | 662 @end |
| OLD | NEW |