| Index: mojo/services/native_viewport/native_viewport_mac.mm
|
| diff --git a/mojo/services/native_viewport/native_viewport_mac.mm b/mojo/services/native_viewport/native_viewport_mac.mm
|
| index e60774fdf20ffcbde32b4f5123c338d24fffeeae..d263e4247dd2d8fd8f5c681273ca7d119b8ed342 100644
|
| --- a/mojo/services/native_viewport/native_viewport_mac.mm
|
| +++ b/mojo/services/native_viewport/native_viewport_mac.mm
|
| @@ -20,15 +20,6 @@ class NativeViewportMac : public NativeViewport {
|
| : delegate_(delegate),
|
| window_(nil),
|
| rect_(10, 10, 500, 500) {
|
| - [NSApplication sharedApplication];
|
| -
|
| - window_ = [[NSWindow alloc]
|
| - initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
|
| - styleMask:NSTitledWindowMask
|
| - backing:NSBackingStoreBuffered
|
| - defer:NO];
|
| - [window_ orderFront:nil];
|
| - delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
|
| }
|
|
|
| virtual ~NativeViewportMac() {
|
| @@ -42,6 +33,18 @@ class NativeViewportMac : public NativeViewport {
|
| return rect_.size();
|
| }
|
|
|
| + virtual void Open() OVERRIDE {
|
| + [NSApplication sharedApplication];
|
| +
|
| + window_ = [[NSWindow alloc]
|
| + initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
|
| + styleMask:NSTitledWindowMask
|
| + backing:NSBackingStoreBuffered
|
| + defer:NO];
|
| + [window_ orderFront:nil];
|
| + delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
|
| + }
|
| +
|
| virtual void Close() OVERRIDE {
|
| // TODO(beng): perform this in response to NSWindow destruction.
|
| delegate_->OnDestroyed();
|
|
|