Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / views / apps / app_window_native_widget_mac.mm
blob935d52d9556b7cc8b7600880cdaa5cfa1f566231
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/apps/app_window_native_widget_mac.h"
7 #import <Cocoa/Cocoa.h>
9 #import "chrome/browser/ui/views/frame/native_widget_mac_frameless_nswindow.h"
10 #import "ui/base/cocoa/window_size_constants.h"
12 AppWindowNativeWidgetMac::AppWindowNativeWidgetMac(views::Widget* widget)
13     : NativeWidgetMac(widget) {
16 AppWindowNativeWidgetMac::~AppWindowNativeWidgetMac() {
19 NSWindow* AppWindowNativeWidgetMac::CreateNSWindow(
20     const views::Widget::InitParams& params) {
21   // If the window has a standard frame, use the same NSWindow as
22   // NativeWidgetMac.
23   if (!params.remove_standard_frame)
24     return NativeWidgetMac::CreateNSWindow(params);
26   // NSTexturedBackgroundWindowMask is needed to implement draggable window
27   // regions.
28   NSUInteger style_mask = NSTexturedBackgroundWindowMask | NSTitledWindowMask |
29                           NSClosableWindowMask | NSMiniaturizableWindowMask |
30                           NSResizableWindowMask;
31   return [[[NativeWidgetMacFramelessNSWindow alloc]
32       initWithContentRect:ui::kWindowSizeDeterminedLater
33                 styleMask:style_mask
34                   backing:NSBackingStoreBuffered
35                     defer:YES] autorelease];