Index: chrome/browser/ui/panels/panel_window_controller_cocoa.mm |
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm |
index d48f204f791c34606f217a459d1b3d728ee1b427..cd0f6f0f64f09b5141f0bf49cc08dff26be546b1 100644 |
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm |
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm |
@@ -9,7 +9,10 @@ |
#include "base/logging.h" |
#include "base/mac/mac_util.h" |
#include "chrome/app/chrome_command_ids.h" // IDC_* |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/tabs/tab_strip_model.h" |
+#include "chrome/browser/themes/theme_service.h" |
+#include "chrome/browser/themes/theme_service_factory.h" |
#include "chrome/browser/ui/browser.h" |
#import "chrome/browser/ui/cocoa/event_utils.h" |
#import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
@@ -32,6 +35,27 @@ const int kMinimumWindowSize = 1; |
return self; |
} |
+- (ui::ThemeProvider*)themeProvider { |
+ return ThemeServiceFactory::GetForProfile(windowShim_->browser()->profile()); |
+} |
+ |
+- (ThemedWindowStyle)themedWindowStyle { |
+ ThemedWindowStyle style = THEMED_POPUP; |
+ if (windowShim_->browser()->profile()->IsOffTheRecord()) |
+ style |= THEMED_INCOGNITO; |
+ return style; |
+} |
+ |
+- (NSPoint)themePatternPhase { |
+ // TODO(dcheng): These constants and the following logic are duplicated from |
Dmitry Titov
2011/08/27 20:30:58
Lets just share this code in this patch the new ut
dcheng
2011/08/31 00:05:04
Done.
|
+ // BrowserWindowController. Determine if we need to share the code somehow or |
+ // if we will always use the same constants as BrowserWindowController. |
+ const CGFloat kPatternHorizontalOffset = -5; |
+ const CGFloat kPatternVerticalOffset = 2; |
+ NSView* windowView = [[[self window] contentView] superview]; |
+ return NSMakePoint(kPatternHorizontalOffset, windowView + kPatternVerticalOffset); |
+} |
+ |
- (void)awakeFromNib { |
NSWindow* window = [self window]; |
@@ -93,7 +117,9 @@ const int kMinimumWindowSize = 1; |
- (void)addFindBar:(FindBarCocoaController*)findBarCocoaController { |
NSView* contentView = [[self window] contentView]; |
- [contentView addSubview:[findBarCocoaController view]]; |
+ // Append as the last subview of the superview so that we can draw over our |
+ // custom title bar, which draws over the native title bar. |
+ [[contentView superview] addSubview:[findBarCocoaController view]]; |
CGFloat maxY = NSMaxY([contentView frame]); |
CGFloat maxWidth = NSWidth([contentView frame]); |