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

Unified Diff: mojo/services/native_viewport/native_viewport_mac.mm

Issue 65883002: mojo_shell crashes on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: 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();

Powered by Google App Engine
This is Rietveld 408576698