Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / full_size_content_window.h
blob25bb91db9705aa7dd90386a44e987635d3e79c1f
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_
6 #define CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_
8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
10 #include "base/mac/scoped_nsobject.h"
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
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
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.
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.
22 // This class currently does not support changing the window's style after the
23 // window has been initialized.
24 @interface FullSizeContentWindow : ChromeEventProcessingWindow {
25 @private
26 // Holds the view that replaces [window contentView]. This view has the same
27 // size as the window. Empty if there is no titlebar.
28 base::scoped_nsobject<NSView> chromeWindowView_;
31 // Designated initializer.
32 - (instancetype)initWithContentRect:(NSRect)contentRect
33 styleMask:(NSUInteger)windowStyle
34 backing:(NSBackingStoreType)bufferingType
35 defer:(BOOL)deferCreation
36 wantsViewsOverTitlebar:(BOOL)wantsViewsOverTitlebar;
38 // Forces the contentView to resize to the given size. This need to be forced
39 // because by default, the contentView will always have the same size as the
40 // window.
41 - (void)forceContentViewSize:(NSSize)size;
43 @end
45 #endif // CHROME_BROWSER_UI_COCOA_FULL_SIZE_CONTENT_WINDOW_H_