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

Side by Side Diff: ios/chrome/browser/ui/settings/settings_navigation_controller.mm

Issue 2713173002: Don't dismiss Settings when another view controller is presented on top (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698