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 #include "ios/chrome/browser/infobars/infobar_controller.h" | 5 #include "ios/chrome/browser/infobars/infobar_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "ios/public/provider/chrome/browser/ui/infobar_view_protocol.h" | 9 #import "ios/public/provider/chrome/browser/ui/infobar_view_protocol.h" |
10 | 10 |
11 @interface InfoBarController () { | 11 @interface InfoBarController () { |
12 base::scoped_nsobject<UIView<InfoBarViewProtocol>> _infoBarView; | 12 base::scoped_nsobject<UIView<InfoBarViewProtocol>> _infoBarView; |
13 } | 13 } |
14 @end | 14 @end |
15 | 15 |
16 @implementation InfoBarController | 16 @implementation InfoBarController |
17 @synthesize delegate = _delegate; | 17 @synthesize delegate = _delegate; |
18 | 18 |
19 - (instancetype)init { | |
sdefresne
2015/06/10 16:57:28
nit: I don't really mind, but we were asked to try
justincohen
2015/06/10 17:06:48
Done.
| |
20 NOTREACHED(); | |
21 return nil; | |
22 } | |
23 | |
19 - (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate { | 24 - (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate { |
20 self = [super init]; | 25 self = [super init]; |
21 if (self) { | 26 if (self) { |
22 DCHECK(delegate); | 27 DCHECK(delegate); |
23 _delegate = delegate; | 28 _delegate = delegate; |
24 } | 29 } |
25 return self; | 30 return self; |
26 } | 31 } |
27 | 32 |
28 - (void)dealloc { | 33 - (void)dealloc { |
(...skipping 30 matching lines...) Expand all Loading... | |
59 - (void)removeView { | 64 - (void)removeView { |
60 [_infoBarView removeFromSuperview]; | 65 [_infoBarView removeFromSuperview]; |
61 } | 66 } |
62 | 67 |
63 - (void)detachView { | 68 - (void)detachView { |
64 [_infoBarView resetDelegate]; | 69 [_infoBarView resetDelegate]; |
65 _delegate = nullptr; | 70 _delegate = nullptr; |
66 } | 71 } |
67 | 72 |
68 @end | 73 @end |
OLD | NEW |