Skip to content

Commit

Permalink
Fix missing image of "new tab" button in incognito mode
Browse files Browse the repository at this point in the history
TabGridNewTabButton is inited with page=TabGridPageIncognitoTabs, and
depends on "setPage:" method to set the image of button. However this
"setPage" has an early return for same page value, so when app is
launched in incognito mode, the image will be missing.

(cherry picked from commit ebcf8f6)

Bug: 991994
Change-Id: I7fd4f90a57486392f12ffab339f81517dbf25bcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746262
Commit-Queue: Yi Su <mrsuyi@chromium.org>
Reviewed-by: edchin <edchin@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#686345}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751962
Reviewed-by: Kariah Davis <kariahda@chromium.org>
Cr-Commit-Position: refs/branch-heads/3881@{#3}
Cr-Branched-From: d4f8b3f-refs/heads/master@{#686257}
  • Loading branch information
Yi Su authored and Kariah Davis committed Aug 13, 2019
1 parent 7f07535 commit cab2221
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ios/chrome/browser/ui/tab_grid/tab_grid_new_tab_button.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ - (instancetype)initWithRegularImage:(UIImage*)regularImage
#pragma mark - Public

- (void)setPage:(TabGridPage)page {
if (page == _page)
return;
// self.page is inited to 0 (i.e. TabGridPageIncognito) so do not early return
// here, otherwise when app is launched in incognito mode the image will be
// missing.
UIImage* renderedImage;
switch (page) {
case TabGridPageIncognitoTabs:
Expand Down

0 comments on commit cab2221

Please sign in to comment.