Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10917274: Re-enable native UI for {frame:'chrome'} in app windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only allow {frame:'experimental-html'} when --enable-experimental-extension-apis Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index 88b5c4fe3c896e524d508c0e4d53d8922565e3b1..afea8ed8979528b90ef4875d180f0d5dc249e63f 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -79,18 +79,18 @@
@end
-@interface ShellNSWindow : ChromeEventProcessingWindow
-
-- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
-
-@end
-
// This is really a method on NSGrayFrame, so it should only be called on the
// view passed into -[NSWindow drawCustomFrameRect:forView:].
@interface NSView (PrivateMethods)
- (CGFloat)roundedCornerRadius;
@end
+@interface ShellNSWindow : ChromeEventProcessingWindow
+
+- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
+
+@end
+
@implementation ShellNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
@@ -109,6 +109,14 @@
NSRectFill(rect);
}
+@end
+
+@interface ShellFramelessNSWindow : ShellNSWindow
+
+@end
+
+@implementation ShellFramelessNSWindow
+
+ (NSRect)frameRectForContentRect:(NSRect)contentRect
styleMask:(NSUInteger)mask {
return contentRect;
@@ -168,7 +176,15 @@ ShellWindowCocoa::ShellWindowCocoa(ShellWindow* shell_window,
NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask |
NSTexturedBackgroundWindowMask;
- scoped_nsobject<NSWindow> window([[ShellNSWindow alloc]
+ scoped_nsobject<NSWindow> window;
+ if (has_frame_)
Robert Sesek 2012/09/17 18:50:45 Multi-line bodies need {} braces.
+ window.reset([[ShellNSWindow alloc]
+ initWithContentRect:cocoa_bounds
Robert Sesek 2012/09/17 18:50:45 nit: continuations need to be indented 4 spaces fr
+ styleMask:style_mask
+ backing:NSBackingStoreBuffered
+ defer:NO]);
+ else
+ window.reset([[ShellFramelessNSWindow alloc]
initWithContentRect:cocoa_bounds
styleMask:style_mask
backing:NSBackingStoreBuffered
« no previous file with comments | « chrome/browser/extensions/api/app_window/app_window_api.cc ('k') | chrome/browser/ui/extensions/shell_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698