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

Unified Diff: chrome/browser/ui/cocoa/download/download_shelf_controller.mm

Issue 615663002: Mac: Remove download shelf from AX hierarchy when not visible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/download/download_shelf_controller.mm
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
index d2bf53e896aad1ce616b27490c1a29395080ebf3..93ec81b3c23514da7e445fea95d11a01ea50d1c5 100644
--- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
+++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
@@ -252,10 +252,12 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
// do no animation over janky animation. Find a way to make animating in
// smoother.
AnimatableView* view = [self animatableView];
- if (show)
+ if (show) {
[view setHeight:maxShelfHeight_];
- else
+ [view setHidden:NO];
+ } else {
[view animateToNewHeight:0 duration:kDownloadShelfCloseDuration];
+ }
barIsVisible_ = show;
[self updateCloseButton];
@@ -270,8 +272,10 @@ const NSSize kHoverCloseButtonDefaultSize = { 18, 18 };
}
- (void)animationDidEnd:(NSAnimation*)animation {
- if (![self isVisible])
+ if (![self isVisible]) {
[self closed];
+ [[self view] setHidden:YES]; // So that it doesn't appear in AX hierarchy.
+ }
}
- (float)height {
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698