OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ | 5 #ifndef UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ |
6 #define UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ | 6 #define UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include "base/mac/scoped_nsobject.h" | |
11 #include "third_party/skia/include/core/SkColor.h" | |
8 #include "ui/gfx/gfx_export.h" | 12 #include "ui/gfx/gfx_export.h" |
9 | 13 |
10 @class NSWindow; | 14 // A view that paints a solid color. Used to change the title bar background. |
15 GFX_EXPORT @interface TitlebarBackgroundView : NSView { | |
16 @private | |
17 base::scoped_nsobject<NSColor> color_; | |
18 base::scoped_nsobject<NSColor> inactiveColor_; | |
19 } | |
20 - (void)setColor:(NSColor*)color inactiveColor:(NSColor*)inactiveColor; | |
21 @end | |
11 | 22 |
12 namespace gfx { | 23 namespace gfx { |
13 | |
14 class Size; | 24 class Size; |
15 | 25 |
16 // Set whether the window can be fullscreened. | 26 // Set whether the window can be fullscreened. |
17 GFX_EXPORT void SetNSWindowCanFullscreen(NSWindow* window, | 27 GFX_EXPORT void SetNSWindowCanFullscreen(NSWindow* window, |
18 bool allow_fullscreen); | 28 bool allow_fullscreen); |
19 | 29 |
20 // Sets the min/max size of the window as well as showing/hiding resize, | 30 // Sets the min/max size of the window as well as showing/hiding resize, |
21 // maximize, and fullscreen controls. | 31 // maximize, and fullscreen controls. |
22 // Sizes refer to the content size (inner bounds). | 32 // Sizes refer to the content size (inner bounds). |
23 GFX_EXPORT void ApplyNSWindowSizeConstraints(NSWindow* window, | 33 GFX_EXPORT void ApplyNSWindowSizeConstraints(NSWindow* window, |
24 const gfx::Size& min_size, | 34 const gfx::Size& min_size, |
25 const gfx::Size& max_size, | 35 const gfx::Size& max_size, |
26 bool can_resize, | 36 bool can_resize, |
27 bool can_fullscreen); | 37 bool can_fullscreen); |
28 | 38 |
39 // Adds a TitlebarBackgroundView to the [[window contentView] superView]. | |
40 GFX_EXPORT void AddColoredTitlebarToNSWindow( | |
jackhou1
2015/04/24 07:05:03
Should we merge TitlebarBackgroundView and TabStri
tapted
2015/05/06 02:58:29
I'd lean towards "nah" - probably not enough in co
| |
41 NSWindow * window, SkColor active_color, SkColor inactive_color); | |
42 | |
29 } // namespace gfx | 43 } // namespace gfx |
30 | 44 |
31 #endif // UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ | 45 #endif // UI_GFX_MAC_NSWINDOW_FRAME_CONTROLS_H_ |
OLD | NEW |