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 #import "chrome/browser/cocoa/fullscreen_window.h" | 5 #import "chrome/browser/cocoa/fullscreen_window.h" |
6 | 6 |
7 #include "base/mac_util.h" | 7 #include "base/mac_util.h" |
8 #include "chrome/browser/browser_theme_provider.h" | 8 #include "chrome/browser/browser_theme_provider.h" |
9 #import "chrome/browser/cocoa/themed_window.h" | 9 #import "chrome/browser/cocoa/themed_window.h" |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Explicitly enable |-performClose:| (see above); otherwise the fact that | 77 // Explicitly enable |-performClose:| (see above); otherwise the fact that |
78 // this window does not have a close button results in it being disabled. | 78 // this window does not have a close button results in it being disabled. |
79 if (action == @selector(performClose:)) | 79 if (action == @selector(performClose:)) |
80 return YES; | 80 return YES; |
81 | 81 |
82 return [super validateUserInterfaceItem:item]; | 82 return [super validateUserInterfaceItem:item]; |
83 } | 83 } |
84 | 84 |
85 - (ThemeProvider*)themeProvider { | 85 - (ThemeProvider*)themeProvider { |
86 return [[self delegate] themeProvider]; | 86 id delegate = [self delegate]; |
| 87 if (![delegate respondsToSelector:@selector(themeProvider)]) |
| 88 return NULL; |
| 89 return [delegate themeProvider]; |
87 } | 90 } |
88 | 91 |
89 - (ThemedWindowStyle)themedWindowStyle { | 92 - (ThemedWindowStyle)themedWindowStyle { |
90 return [[self delegate] themedWindowStyle]; | 93 id delegate = [self delegate]; |
| 94 if (![delegate respondsToSelector:@selector(themedWindowStyle)]) |
| 95 return THEMED_NORMAL; |
| 96 return [delegate themedWindowStyle]; |
91 } | 97 } |
92 | 98 |
93 - (NSPoint)themePatternPhase { | 99 - (NSPoint)themePatternPhase { |
94 return [[self delegate] themePatternPhase]; | 100 id delegate = [self delegate]; |
| 101 if (![delegate respondsToSelector:@selector(themePatternPhase)]) |
| 102 return NSMakePoint(0, 0); |
| 103 return [delegate themePatternPhase]; |
95 } | 104 } |
96 | 105 |
97 @end | 106 @end |
OLD | NEW |