Commit 333ad1de authored by jackhou@chromium.org's avatar jackhou@chromium.org

Always set NSTexturedBackgroundWindowMask on app windows.

This is consistent with FramedBrowserWindow.

This also skips drawing the frame of frameless windows.

On OSX 10.7, if NSTexturedBackgroundWindowMask is set, NSGrayFrame is
used to draw the frame. If not, NSThemeFrame is used. Since we swizzle
drawing methods on NSGrayFrame on 10.7, the app windows should all use
NSGrayFrame.

BUG=378581

Review URL: https://codereview.chromium.org/307843002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273781 0039d316-1c4b-4281-b951-d872f2087c98
parent 0a102872
...@@ -168,9 +168,7 @@ class NativeAppWindowCocoa : public apps::NativeAppWindow, ...@@ -168,9 +168,7 @@ class NativeAppWindowCocoa : public apps::NativeAppWindow,
content::WebContents* WebContents() const; content::WebContents* WebContents() const;
// Returns the WindowStyleMask based on the type of window frame. // Returns the WindowStyleMask based on the type of window frame.
// Specifically, this includes NSResizableWindowMask if the window is // This includes NSResizableWindowMask if the window is resizable.
// resizable, and does not include NSTexturedBackgroundWindowMask when a
// native frame is used.
NSUInteger GetWindowStyleMask() const; NSUInteger GetWindowStyleMask() const;
void InstallView(); void InstallView();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h" #include "chrome/browser/ui/cocoa/browser_window_utils.h"
#import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h"
#import "chrome/browser/ui/cocoa/custom_frame_view.h"
#include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.h" #include "chrome/browser/ui/cocoa/extensions/extension_keybinding_registry_cocoa.h"
#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" #include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h"
#import "chrome/browser/ui/cocoa/nsview_additions.h" #import "chrome/browser/ui/cocoa/nsview_additions.h"
...@@ -223,9 +224,6 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions( ...@@ -223,9 +224,6 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions(
@end @end
@interface ShellCustomFrameNSWindow : ShellNSWindow @interface ShellCustomFrameNSWindow : ShellNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view;
@end @end
@implementation ShellCustomFrameNSWindow @implementation ShellCustomFrameNSWindow
...@@ -248,12 +246,13 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions( ...@@ -248,12 +246,13 @@ std::vector<gfx::Rect> CalculateNonDraggableRegions(
@end @end
@interface ShellFramelessNSWindow : ShellCustomFrameNSWindow @interface ShellFramelessNSWindow : ShellNSWindow
@end @end
@implementation ShellFramelessNSWindow @implementation ShellFramelessNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {}
+ (NSRect)frameRectForContentRect:(NSRect)contentRect + (NSRect)frameRectForContentRect:(NSRect)contentRect
styleMask:(NSUInteger)mask { styleMask:(NSUInteger)mask {
return contentRect; return contentRect;
...@@ -373,14 +372,10 @@ NativeAppWindowCocoa::NativeAppWindowCocoa( ...@@ -373,14 +372,10 @@ NativeAppWindowCocoa::NativeAppWindowCocoa(
NSUInteger NativeAppWindowCocoa::GetWindowStyleMask() const { NSUInteger NativeAppWindowCocoa::GetWindowStyleMask() const {
NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask | NSUInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask; NSMiniaturizableWindowMask |
NSTexturedBackgroundWindowMask;
if (shows_resize_controls_) if (shows_resize_controls_)
style_mask |= NSResizableWindowMask; style_mask |= NSResizableWindowMask;
if (!has_frame_ ||
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAppsUseNativeFrame)) {
style_mask |= NSTexturedBackgroundWindowMask;
}
return style_mask; return style_mask;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment