Skip to content

Commit

Permalink
Use new folder icon in folder picker when new bookmark flag is on.
Browse files Browse the repository at this point in the history
Bug: 774651
Change-Id: I91c3120212926bb76e95517874f992ceb04d5359
Reviewed-on: https://chromium-review.googlesource.com/722360
Commit-Queue: Sylvain Defresne <[email protected]>
Reviewed-by: Sylvain Defresne <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#509393}(cherry picked from commit 02dc512)
Reviewed-on: https://chromium-review.googlesource.com/727441
Reviewed-by: Marti Wong <[email protected]>
Cr-Commit-Position: refs/branch-heads/3239@{#61}
Cr-Branched-From: adb61db-refs/heads/master@{#508578}
  • Loading branch information
Marti Wong committed Oct 19, 2017
1 parent b050aad commit c0643eb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#import "ios/chrome/browser/ui/bookmarks/bookmark_folder_table_view_cell.h"

#include "ios/chrome/browser/bookmarks/bookmark_new_generation_features.h"
#import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
#import "ios/chrome/browser/ui/rtl_geometry.h"
#include "ios/chrome/grit/ios_strings.h"
Expand Down Expand Up @@ -42,7 +43,8 @@ + (instancetype)folderCell {
[[[self class] alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:[self folderCellReuseIdentifier]];
folderCell.indentationWidth = kFolderCellIndentationWidth;
folderCell.imageView.image = [UIImage imageNamed:@"bookmark_gray_folder"];
folderCell.imageView.image =
[UIImage imageNamed:[[self class] bookmarkFolderImageName]];
return folderCell;
}

Expand All @@ -65,7 +67,8 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style
self.textLabel.font = [MDCTypography subheadFont];
self.textLabel.textColor = bookmark_utils_ios::darkTextColor();
self.selectionStyle = UITableViewCellSelectionStyleGray;
self.imageView.image = [UIImage imageNamed:@"bookmark_gray_folder"];
self.imageView.image =
[UIImage imageNamed:[[self class] bookmarkFolderImageName]];
self.accessibilityTraits |= UIAccessibilityTraitButton;
_enabled = YES;
}
Expand Down Expand Up @@ -113,4 +116,15 @@ - (void)prepareForReuse {
self.enabled = YES;
}

#pragma mark - Private

// TODO(crbug.com/695749): Remove this function and use bookmark_gray_folder
// only when the new folder picker (and its folder cell class) is created for
// the new ui.
+ (NSString*)bookmarkFolderImageName {
return (base::FeatureList::IsEnabled(kBookmarkNewGeneration))
? @"bookmark_gray_folder_new"
: @"bookmark_gray_folder";
}

@end

0 comments on commit c0643eb

Please sign in to comment.