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

Side by Side Diff: chrome/browser/ui/cocoa/full_size_content_window.h

Issue 1276383004: Implemented fullscreen exit animation with AppKit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made some changes according to missed comments on Patch Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_
6 #define CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_ 6 #define CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_
7 7
8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
9 9
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
11 11
12 // By default, the contentView does not occupy the full size of a framed 12 // By default, the contentView does not occupy the full size of a framed
13 // window. Chrome still wants to draw in the title bar. Historically, Chrome 13 // window. Chrome still wants to draw in the title bar. Historically, Chrome
14 // has done this by adding subviews directly to the root view. This causes 14 // has done this by adding subviews directly to the root view. This causes
15 // several problems. The most egregious is related to layer ordering when the 15 // several problems. The most egregious is related to layer ordering when the
16 // root view does not have a layer. By giving the contentView the same size as 16 // root view does not have a layer. By giving the contentView the same size as
17 // the window, there is no longer any need to add subviews to the root view. 17 // the window, there is no longer any need to add subviews to the root view.
18 // 18 //
19 // If the window does not have a titlebar, then its contentView already has the 19 // If the window does not have a titlebar, then its contentView already has the
20 // same size as the window. In this case, this class has no effect. 20 // same size as the window. In this case, this class has no effect.
21 // 21 //
22 // This class currently does not support changing the window's style after the 22 // This class currently does not support changing the window's style after the
23 // window has been initialized. 23 // window has been initialized.
24
25 // This view always takes the size of its superview. It is intended to be used
26 // as a NSWindow's contentView. It is needed because NSWindow's implementation
27 // explicitly resizes the contentView at inopportune times.
28 @interface FullSizeContentView : NSView
29
30 // This method is directly called by AppKit during a live window resize.
31 // Override it to prevent the content view from shrinking.
32 - (void)setFrameSize:(NSSize)size;
33
34 // This method allows us to set the content view size since setFrameSize is
35 // overridden to prevent the view from shrinking
36 - (void)forceFrameSize:(NSSize)size;
erikchen 2015/08/12 22:08:53 (I should have made this comment in my first revie
spqchan1 2015/08/13 20:38:48 Done.
spqchan1 2015/08/13 20:38:48 Done.
37
38 @end
39
24 @interface FullSizeContentWindow : ChromeEventProcessingWindow { 40 @interface FullSizeContentWindow : ChromeEventProcessingWindow {
25 @private 41 @private
26 // Holds the view that replaces [window contentView]. This view has the same 42 // Holds the view that replaces [window contentView]. This view has the same
27 // size as the window. Empty if there is no titlebar. 43 // size as the window. Empty if there is no titlebar.
28 base::scoped_nsobject<NSView> chromeWindowView_; 44 base::scoped_nsobject<NSView> chromeWindowView_;
29 } 45 }
30 46
31 // Designated initializer. 47 // Designated initializer.
32 - (instancetype)initWithContentRect:(NSRect)contentRect 48 - (instancetype)initWithContentRect:(NSRect)contentRect
33 styleMask:(NSUInteger)windowStyle 49 styleMask:(NSUInteger)windowStyle
34 backing:(NSBackingStoreType)bufferingType 50 backing:(NSBackingStoreType)bufferingType
35 defer:(BOOL)deferCreation 51 defer:(BOOL)deferCreation
36 wantsViewsOverTitlebar:(BOOL)wantsViewsOverTitlebar; 52 wantsViewsOverTitlebar:(BOOL)wantsViewsOverTitlebar;
37 53
38 @end 54 @end
39 55
40 #endif // CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_ 56 #endif // CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698