OLD | NEW |
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 #include "ios/chrome/browser/infobars/confirm_infobar_controller.h" | 5 #include "ios/chrome/browser/infobars/confirm_infobar_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 @interface ConfirmInfoBarController () | 41 @interface ConfirmInfoBarController () |
42 | 42 |
43 // Action for any of the user defined buttons. | 43 // Action for any of the user defined buttons. |
44 - (void)infoBarButtonDidPress:(id)sender; | 44 - (void)infoBarButtonDidPress:(id)sender; |
45 // Action for any of the user defined links. | 45 // Action for any of the user defined links. |
46 - (void)infobarLinkDidPress:(NSNumber*)tag; | 46 - (void)infobarLinkDidPress:(NSNumber*)tag; |
47 - (void)updateInfobarLabel:(UIView<InfoBarViewProtocol>*)view; | 47 - (void)updateInfobarLabel:(UIView<InfoBarViewProtocol>*)view; |
48 @end | 48 @end |
49 | 49 |
50 @implementation ConfirmInfoBarController { | 50 @implementation ConfirmInfoBarController { |
51 __weak ConfirmInfoBarDelegate* confirmInfobarDelegate_; | 51 ConfirmInfoBarDelegate* confirmInfobarDelegate_; // weak |
52 } | 52 } |
53 | 53 |
54 #pragma mark - | 54 #pragma mark - |
55 #pragma mark InfoBarController | 55 #pragma mark InfoBarController |
56 | 56 |
57 - (base::scoped_nsobject<UIView<InfoBarViewProtocol>>) | 57 - (base::scoped_nsobject<UIView<InfoBarViewProtocol>>) |
58 viewForDelegate:(infobars::InfoBarDelegate*)delegate | 58 viewForDelegate:(infobars::InfoBarDelegate*)delegate |
59 frame:(CGRect)frame { | 59 frame:(CGRect)frame { |
60 base::scoped_nsobject<UIView<InfoBarViewProtocol>> infoBarView; | 60 base::scoped_nsobject<UIView<InfoBarViewProtocol>> infoBarView; |
61 confirmInfobarDelegate_ = delegate->AsConfirmInfoBarDelegate(); | 61 confirmInfobarDelegate_ = delegate->AsConfirmInfoBarDelegate(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 DCHECK([tag isKindOfClass:[NSNumber class]]); | 151 DCHECK([tag isKindOfClass:[NSNumber class]]); |
152 if (!self.delegate) { | 152 if (!self.delegate) { |
153 return; | 153 return; |
154 } | 154 } |
155 if ([tag unsignedIntegerValue] == ConfirmInfoBarUITags::TITLE_LINK) { | 155 if ([tag unsignedIntegerValue] == ConfirmInfoBarUITags::TITLE_LINK) { |
156 confirmInfobarDelegate_->LinkClicked(NEW_FOREGROUND_TAB); | 156 confirmInfobarDelegate_->LinkClicked(NEW_FOREGROUND_TAB); |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 @end | 160 @end |
OLD | NEW |