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

Unified Diff: chrome/browser/ui/cocoa/full_size_content_window.mm

Issue 1408033010: Fix for Exit Fullscreen Animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment 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 | « chrome/browser/ui/cocoa/full_size_content_window.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/full_size_content_window.mm
diff --git a/chrome/browser/ui/cocoa/full_size_content_window.mm b/chrome/browser/ui/cocoa/full_size_content_window.mm
index 04c76986226669f6222f2ff82c5be074ee75fd01..555c523fa209983c74662b42b9cfb23c12e579ca 100644
--- a/chrome/browser/ui/cocoa/full_size_content_window.mm
+++ b/chrome/browser/ui/cocoa/full_size_content_window.mm
@@ -16,11 +16,13 @@
// This view always takes the size of its superview. It is intended to be used
// as a NSWindow's contentView. It is needed because NSWindow's implementation
// explicitly resizes the contentView at inopportune times.
-@interface FullSizeContentView : NSView
+@interface FullSizeContentView : NSView {
+ BOOL forceFrameFlag_;
+}
// This method allows us to set the content view size since setFrameSize is
// overridden to prevent the view from shrinking.
-- (void)forceFrameSize:(NSSize)size;
+- (void)forceFrame:(NSRect)frame;
@end
@@ -29,13 +31,15 @@
// This method is directly called by AppKit during a live window resize.
// Override it to prevent the content view from shrinking.
- (void)setFrameSize:(NSSize)size {
- if ([self superview])
+ if ([self superview] && !forceFrameFlag_)
size = [[self superview] bounds].size;
[super setFrameSize:size];
}
-- (void)forceFrameSize:(NSSize)size {
- [super setFrameSize:size];
+- (void)forceFrame:(NSRect)frame {
+ forceFrameFlag_ = YES;
+ [super setFrame:frame];
+ forceFrameFlag_ = NO;
}
@end
@@ -91,10 +95,10 @@
return self;
}
-- (void)forceContentViewSize:(NSSize)size {
+- (void)forceContentViewFrame:(NSRect)frame {
FullSizeContentView* contentView =
base::mac::ObjCCast<FullSizeContentView>(chromeWindowView_);
- [contentView forceFrameSize:size];
+ [contentView forceFrame:frame];
}
#pragma mark - Private Methods
« no previous file with comments | « chrome/browser/ui/cocoa/full_size_content_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698