Commit 2bef755e authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Add accessibility identifier for "show history" cell in Recent Tabs

Change-Id: Ib6bcee51114a9fcb05aacd9079d52b65356e18d2
Reviewed-on: https://chromium-review.googlesource.com/1171680
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582383}
parent afe7c741
...@@ -11,5 +11,7 @@ ...@@ -11,5 +11,7 @@
extern NSString* const kCollapsedSectionsKey; extern NSString* const kCollapsedSectionsKey;
// Accessibility identifier for the main view. // Accessibility identifier for the main view.
extern NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier; extern NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier;
// Accessibility identifier for the "Show History" cell.
extern NSString* const kRecentTabsShowFullHistoryCellAccessibilityIdentifier;
#endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_RECENT_TABS_CONSTANTS_H_ #endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_RECENT_TABS_CONSTANTS_H_
...@@ -11,3 +11,5 @@ ...@@ -11,3 +11,5 @@
NSString* const kCollapsedSectionsKey = @"ChromeRecentTabsCollapsedSections"; NSString* const kCollapsedSectionsKey = @"ChromeRecentTabsCollapsedSections";
NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier = NSString* const kRecentTabsTableViewControllerAccessibilityIdentifier =
@"recent_tabs_view_controller"; @"recent_tabs_view_controller";
NSString* const kRecentTabsShowFullHistoryCellAccessibilityIdentifier =
@"kRecentTabsShowFullHistoryCellAccessibilityIdentifier";
...@@ -215,6 +215,8 @@ const int kRecentlyClosedTabsSectionIndex = 0; ...@@ -215,6 +215,8 @@ const int kRecentlyClosedTabsSectionIndex = 0;
[[TableViewAccessoryItem alloc] initWithType:ItemTypeShowFullHistory]; [[TableViewAccessoryItem alloc] initWithType:ItemTypeShowFullHistory];
historyItem.title = l10n_util::GetNSString(IDS_HISTORY_SHOWFULLHISTORY_LINK); historyItem.title = l10n_util::GetNSString(IDS_HISTORY_SHOWFULLHISTORY_LINK);
historyItem.image = [UIImage imageNamed:@"show_history"]; historyItem.image = [UIImage imageNamed:@"show_history"];
historyItem.cellAccessibilityIdentifier =
kRecentTabsShowFullHistoryCellAccessibilityIdentifier;
[model addItem:historyItem [model addItem:historyItem
toSectionWithIdentifier:SectionIdentifierRecentlyClosedTabs]; toSectionWithIdentifier:SectionIdentifierRecentlyClosedTabs];
} }
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
@property(nonatomic, readwrite, strong) UIImage* image; @property(nonatomic, readwrite, strong) UIImage* image;
// The title label in the cell. // The title label in the cell.
@property(nonatomic, readwrite, copy) NSString* title; @property(nonatomic, readwrite, copy) NSString* title;
// The accessibility identifier for the cell.
@property(nonatomic, readwrite, copy) NSString* cellAccessibilityIdentifier;
@end @end
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
@implementation TableViewAccessoryItem @implementation TableViewAccessoryItem
@synthesize cellAccessibilityIdentifier = _cellAccessibilityIdentifier;
@synthesize image = _image; @synthesize image = _image;
@synthesize title = _title; @synthesize title = _title;
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
} }
cell.titleLabel.text = self.title; cell.titleLabel.text = self.title;
cell.accessibilityIdentifier = self.cellAccessibilityIdentifier;
cell.imageView.backgroundColor = styler.tableViewBackgroundColor; cell.imageView.backgroundColor = styler.tableViewBackgroundColor;
cell.titleLabel.backgroundColor = styler.tableViewBackgroundColor; cell.titleLabel.backgroundColor = styler.tableViewBackgroundColor;
if (styler.cellTitleColor) if (styler.cellTitleColor)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment