Index: ios/chrome/browser/ui/omnibox/page_info_view_controller.mm |
diff --git a/ios/chrome/browser/ui/omnibox/page_info_view_controller.mm b/ios/chrome/browser/ui/omnibox/page_info_view_controller.mm |
index baf87c33b9c64ffddebc29e97b64be5f22a06a3a..051bb5eb6994d8ce965bc4ae69ad7ef9440ff8e3 100644 |
--- a/ios/chrome/browser/ui/omnibox/page_info_view_controller.mm |
+++ b/ios/chrome/browser/ui/omnibox/page_info_view_controller.mm |
@@ -201,6 +201,7 @@ void PageInfoModelBubbleBridge::PerformLayout() { |
@synthesize containerView = containerView_; |
@synthesize popupContainer = popupContainer_; |
+@synthesize dispatcher = dispatcher_; |
- (id)initWithModel:(PageInfoModel*)model |
bridge:(PageInfoModelObserver*)bridge |
@@ -406,6 +407,7 @@ void PageInfoModelBubbleBridge::PerformLayout() { |
} |
- (void)close { |
+ // Refactoring note: _containerView.tag is IDC_HIDE_PAGE_INFO. |
[containerView_ chromeExecuteCommand:containerView_]; |
} |
@@ -471,8 +473,7 @@ void PageInfoModelBubbleBridge::PerformLayout() { |
return nil; |
} |
UIButton* button = [[UIButton alloc] initWithFrame:CGRectZero]; |
- int messageId = IDS_IOS_PAGE_INFO_RELOAD; |
- NSInteger tag = IDC_RELOAD; |
+ int messageId; |
NSString* accessibilityID = @"Reload button"; |
switch (buttonAction) { |
case PageInfoModel::BUTTON_NONE: |
@@ -480,26 +481,27 @@ void PageInfoModelBubbleBridge::PerformLayout() { |
return nil; |
case PageInfoModel::BUTTON_SHOW_SECURITY_HELP: |
messageId = IDS_LEARN_MORE; |
- tag = IDC_SHOW_SECURITY_HELP; |
+ button.tag = IDC_SHOW_SECURITY_HELP; |
accessibilityID = @"Learn more"; |
+ [button addTarget:nil |
+ action:@selector(chromeExecuteCommand:) |
+ forControlEvents:UIControlEventTouchUpInside]; |
break; |
case PageInfoModel::BUTTON_RELOAD: |
messageId = IDS_IOS_PAGE_INFO_RELOAD; |
- tag = IDC_RELOAD; |
accessibilityID = @"Reload button"; |
[button addTarget:self |
action:@selector(close) |
forControlEvents:UIControlEventTouchUpInside]; |
+ [button addTarget:self.dispatcher |
+ action:@selector(reload) |
+ forControlEvents:UIControlEventTouchUpInside]; |
break; |
}; |
NSString* title = l10n_util::GetNSStringWithFixup(messageId); |
SetA11yLabelAndUiAutomationName(button, messageId, accessibilityID); |
[button setTitle:title forState:UIControlStateNormal]; |
- [button setTag:tag]; |
- [button addTarget:nil |
- action:@selector(chromeExecuteCommand:) |
- forControlEvents:UIControlEventTouchUpInside]; |
return button; |
} |