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

Side by Side Diff: mojo/services/native_viewport/native_viewport_mac.mm

Issue 131153007: Send size to NativeViewportClient::OnCreated instead of GLES2Client::DidCreateContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix various issues Created 6 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/services/native_viewport/native_viewport.h" 5 #include "mojo/services/native_viewport/native_viewport.h"
6 6
7 #import <AppKit/NSApplication.h> 7 #import <AppKit/NSApplication.h>
8 #import <AppKit/NSView.h> 8 #import <AppKit/NSView.h>
9 #import <AppKit/NSWindow.h> 9 #import <AppKit/NSWindow.h>
10 10
(...skipping 20 matching lines...) Expand all
31 virtual void Init(const gfx::Rect& bounds) OVERRIDE { 31 virtual void Init(const gfx::Rect& bounds) OVERRIDE {
32 [NSApplication sharedApplication]; 32 [NSApplication sharedApplication];
33 33
34 rect_ = bounds; 34 rect_ = bounds;
35 window_ = [[NSWindow alloc] 35 window_ = [[NSWindow alloc]
36 initWithContentRect:NSRectFromCGRect(rect_.ToCGRect()) 36 initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
37 styleMask:NSTitledWindowMask 37 styleMask:NSTitledWindowMask
38 backing:NSBackingStoreBuffered 38 backing:NSBackingStoreBuffered
39 defer:NO]; 39 defer:NO];
40 delegate_->OnAcceleratedWidgetAvailable([window_ contentView]); 40 delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
41 delegate_->OnBoundsChanged(rect_);
41 } 42 }
42 43
43 virtual void Show() OVERRIDE { 44 virtual void Show() OVERRIDE {
44 [window_ orderFront:nil]; 45 [window_ orderFront:nil];
45 } 46 }
46 47
47 virtual void Close() OVERRIDE { 48 virtual void Close() OVERRIDE {
48 // TODO(beng): perform this in response to NSWindow destruction. 49 // TODO(beng): perform this in response to NSWindow destruction.
49 delegate_->OnDestroyed(); 50 delegate_->OnDestroyed();
50 } 51 }
(...skipping 23 matching lines...) Expand all
74 75
75 // static 76 // static
76 scoped_ptr<NativeViewport> NativeViewport::Create( 77 scoped_ptr<NativeViewport> NativeViewport::Create(
77 shell::Context* context, 78 shell::Context* context,
78 NativeViewportDelegate* delegate) { 79 NativeViewportDelegate* delegate) {
79 return scoped_ptr<NativeViewport>(new NativeViewportMac(delegate)).Pass(); 80 return scoped_ptr<NativeViewport>(new NativeViewportMac(delegate)).Pass();
80 } 81 }
81 82
82 } // namespace services 83 } // namespace services
83 } // namespace mojo 84 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/gles2/gles2_impl.cc ('k') | mojo/services/native_viewport/native_viewport_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698