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

Unified Diff: ios/chrome/browser/ui/omnibox/page_info_view_controller.mm

Issue 2965963002: [ios] Remove IDC_STOP and IDC_RELOAD
Patch Set: Rebased. Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
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;
}
« no previous file with comments | « ios/chrome/browser/ui/omnibox/page_info_view_controller.h ('k') | ios/chrome/browser/ui/popup_menu/popup_menu_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698