OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_THEMED_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 14 matching lines...) Expand all Loading... |
25 enum ThemeImageAlignment { | 25 enum ThemeImageAlignment { |
26 // Aligns the top of the theme image with the top of the frame. Use this | 26 // Aligns the top of the theme image with the top of the frame. Use this |
27 // for IDR_THEME_THEME_FRAME.* | 27 // for IDR_THEME_THEME_FRAME.* |
28 THEME_IMAGE_ALIGN_WITH_FRAME, | 28 THEME_IMAGE_ALIGN_WITH_FRAME, |
29 // Aligns the top of the theme image with the top of the tabs. | 29 // Aligns the top of the theme image with the top of the tabs. |
30 // Use this for IDR_THEME_TAB_BACKGROUND and IDR_THEME_TOOLBAR. | 30 // Use this for IDR_THEME_TAB_BACKGROUND and IDR_THEME_TOOLBAR. |
31 THEME_IMAGE_ALIGN_WITH_TAB_STRIP | 31 THEME_IMAGE_ALIGN_WITH_TAB_STRIP |
32 }; | 32 }; |
33 | 33 |
34 // Implemented by windows that support theming. | 34 // Implemented by windows that support theming. |
35 | |
36 @interface NSWindow (ThemeProvider) | 35 @interface NSWindow (ThemeProvider) |
37 - (ThemeProvider*)themeProvider; | 36 - (ThemeProvider*)themeProvider; |
38 - (ThemedWindowStyle)themedWindowStyle; | 37 - (ThemedWindowStyle)themedWindowStyle; |
39 | 38 |
40 // Returns the position in the coordinates of the root view | 39 // Returns the position in the coordinates of the root view |
41 // ([[self contentView] superview]) that the top left of a theme image with | 40 // ([[self contentView] superview]) that the top left of a theme image with |
42 // |alignment| should be painted at. The result of this method can be used in | 41 // |alignment| should be painted at. The result of this method can be used in |
43 // conjunction with [NSGraphicsContext cr_setPatternPhase:] to set the offset of | 42 // conjunction with [NSGraphicsContext cr_setPatternPhase:] to set the offset of |
44 // pattern colors. | 43 // pattern colors. |
45 - (NSPoint)themeImagePositionForAlignment:(ThemeImageAlignment)alignment; | 44 - (NSPoint)themeImagePositionForAlignment:(ThemeImageAlignment)alignment; |
46 @end | 45 @end |
47 | 46 |
| 47 // Adopted by views that want to redraw when the theme changed, or when the |
| 48 // window's active status changed. |
| 49 @protocol ThemedWindowDrawing |
| 50 |
| 51 // Called by the window controller when the theme changed. |
| 52 - (void)windowDidChangeTheme; |
| 53 |
| 54 // Called by the window controller when the window gained or lost main window |
| 55 // status. |
| 56 - (void)windowDidChangeActive; |
| 57 |
| 58 @end |
| 59 |
48 #endif // CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ | 60 #endif // CHROME_BROWSER_UI_COCOA_THEMED_WINDOW_H_ |
OLD | NEW |