#import <Cocoa/Cocoa.h>
+#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "atom/browser/native_window.h"
void UpdateDraggableRegionsForCustomDrag(
const std::vector<DraggableRegion>& regions);
- NSWindow* window_;
+ base::scoped_nsobject<NSWindow> window_;
bool is_kiosk_;
#include <string>
#include "base/mac/mac_util.h"
-#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/values.h"
#import "atom/browser/ui/cocoa/event_processing_window.h"
defer:YES];
[atomWindow setShell:this];
- window_ = atomWindow;
+ window_.reset(atomWindow);
AtomNSWindowDelegate* delegate =
[[AtomNSWindowDelegate alloc] initWithShell:this];
// Force InspectableWebContents to be destroyed before we destroy window,
// because it may still be observing the window at this time.
inspectable_web_contents_.reset();
-
- if (window_)
- [window_ release];
}
void NativeWindowMac::Close() {
void NativeWindowMac::SetResizable(bool resizable) {
if (resizable) {
[[window_ standardWindowButton:NSWindowZoomButton] setEnabled:YES];
- [window_ setStyleMask:window_.styleMask | NSResizableWindowMask];
+ [window_ setStyleMask:[window_ styleMask] | NSResizableWindowMask];
} else {
[[window_ standardWindowButton:NSWindowZoomButton] setEnabled:NO];
- [window_ setStyleMask:window_.styleMask ^ NSResizableWindowMask];
+ [window_ setStyleMask:[window_ styleMask] ^ NSResizableWindowMask];
}
}