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

Side by Side Diff: ios/chrome/browser/ui/util/top_view_controller.mm

Issue 2819283004: [ObjC ARC] Converts ios/chrome/browser/ui/util:util to ARC. (Closed)
Patch Set: Fix copy for block Created 3 years, 8 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/util/top_view_controller.h" 5 #import "ios/chrome/browser/ui/util/top_view_controller.h"
6 6
7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support."
9 #endif
10
7 namespace top_view_controller { 11 namespace top_view_controller {
8 12
9 UIViewController* TopPresentedViewController() { 13 UIViewController* TopPresentedViewController() {
10 return TopPresentedViewControllerFrom( 14 return TopPresentedViewControllerFrom(
11 [[UIApplication sharedApplication] keyWindow].rootViewController); 15 [[UIApplication sharedApplication] keyWindow].rootViewController);
12 } 16 }
13 UIViewController* TopPresentedViewControllerFrom( 17 UIViewController* TopPresentedViewControllerFrom(
14 UIViewController* base_view_controller) { 18 UIViewController* base_view_controller) {
15 UIViewController* topController = base_view_controller; 19 UIViewController* topController = base_view_controller;
16 for (UIViewController* controller = [topController presentedViewController]; 20 for (UIViewController* controller = [topController presentedViewController];
17 controller && ![controller isBeingDismissed]; 21 controller && ![controller isBeingDismissed];
18 controller = [controller presentedViewController]) { 22 controller = [controller presentedViewController]) {
19 topController = controller; 23 topController = controller;
20 } 24 }
21 return topController; 25 return topController;
22 } 26 }
23 27
24 } // namespace top_view_controller 28 } // namespace top_view_controller
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698