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

Side by Side Diff: ios/chrome/browser/infobars/infobar_container_view.mm

Issue 2574463002: [ObjC ARC] Converts ios/chrome/browser/infobars:infobars to ARC.\n\nAutomatically generated ARCMigr… (Closed)
Patch Set: retain-autorelease Created 4 years 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/infobars/infobar_container_view.h" 5 #import "ios/chrome/browser/infobars/infobar_container_view.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ios/chrome/browser/infobars/infobar.h" 8 #include "ios/chrome/browser/infobars/infobar.h"
9 #include "ios/public/provider/chrome/browser/ui/infobar_view_protocol.h" 9 #include "ios/public/provider/chrome/browser/ui/infobar_view_protocol.h"
10 #include "ui/base/device_form_factor.h" 10 #include "ui/base/device_form_factor.h"
11 11
12 #if !defined(__has_feature) || !__has_feature(objc_arc)
13 #error "This file requires ARC support."
14 #endif
15
12 @implementation InfoBarContainerView 16 @implementation InfoBarContainerView
13 17
14 - (void)addInfoBar:(InfoBarIOS*)infoBarIOS position:(NSInteger)position { 18 - (void)addInfoBar:(InfoBarIOS*)infoBarIOS position:(NSInteger)position {
15 DCHECK_LE((NSUInteger)position, [[self subviews] count]); 19 DCHECK_LE((NSUInteger)position, [[self subviews] count]);
16 CGRect containerBounds = [self bounds]; 20 CGRect containerBounds = [self bounds];
17 infoBarIOS->Layout(containerBounds); 21 infoBarIOS->Layout(containerBounds);
18 UIView* view = infoBarIOS->view(); 22 UIView* view = infoBarIOS->view();
19 [self insertSubview:view atIndex:position]; 23 [self insertSubview:view atIndex:position];
20 } 24 }
21 25
(...skipping 26 matching lines...) Expand all
48 52
49 - (CGFloat)topmostVisibleInfoBarHeight { 53 - (CGFloat)topmostVisibleInfoBarHeight {
50 for (UIView<InfoBarViewProtocol>* view in 54 for (UIView<InfoBarViewProtocol>* view in
51 [self.subviews reverseObjectEnumerator]) { 55 [self.subviews reverseObjectEnumerator]) {
52 return [view sizeThatFits:self.frame.size].height; 56 return [view sizeThatFits:self.frame.size].height;
53 } 57 }
54 return 0; 58 return 0;
55 } 59 }
56 60
57 @end 61 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/infobars/infobar_container_ios.mm ('k') | ios/chrome/browser/infobars/infobar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698