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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm

Issue 1435823003: Fix Omnibox update problem on El Capitan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code refinement. Created 5 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
index 5a70bc5042055f689041096f81f56ccd5b59f395..e0627c79234b08c8e185f8bad54b76b7cebbfa46 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
@@ -7,6 +7,7 @@
#include <cmath>
#include "base/mac/mac_util.h"
+#import "base/mac/sdk_forward_declarations.h"
#include "base/stl_util.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/search/search.h"
@@ -274,19 +275,21 @@ void OmniboxPopupViewMac::PositionPopup(const CGFloat matrixHeight) {
[popup_ setAnimations:@{@"frame" : [NSNull null]}];
}
- if (!animate && base::mac::IsOSElCapitanOrLater()) {
- // When using the animator to make |popup_| larger on El Capitan, for some
- // reason the window does not get redrawn. There's no animation in this case
- // anyway, so just force the frame change. See http://crbug.com/538590 .
- [popup_ setFrame:popup_frame display:YES];
- } else {
- [NSAnimationContext beginGrouping];
- // Don't use the GTM addition for the "Steve" slowdown because this can
- // happen async from user actions and the effects could be a surprise.
- [[NSAnimationContext currentContext] setDuration:kShrinkAnimationDuration];
- [[popup_ animator] setFrame:popup_frame display:YES];
- [NSAnimationContext endGrouping];
+ [NSAnimationContext beginGrouping];
+ // Don't use the GTM addition for the "Steve" slowdown because this can
+ // happen async from user actions and the effects could be a surprise.
+ [[NSAnimationContext currentContext] setDuration:kShrinkAnimationDuration];
+ // When using the animator to update |popup_| on El Capitan, for some reason
+ // the window does not get redrawn. Use a completion handler to make sure
+ // |popup_| gets redrawn once the animation completes. See
+ // http://crbug.com/538590 and http://crbug.com/551007 .
+ if (base::mac::IsOSElCapitanOrLater()) {
+ [[NSAnimationContext currentContext] setCompletionHandler:^{
+ [popup_ display];
+ }];
}
+ [[popup_ animator] setFrame:popup_frame display:YES];
+ [NSAnimationContext endGrouping];
if (!animate) {
// Restore the original animations dictionary. This does not reinstate any
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698