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

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

Issue 769173002: Move native_viewport and gles2 service impls to //services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/platform_viewport_mac.mm
diff --git a/mojo/services/native_viewport/platform_viewport_mac.mm b/mojo/services/native_viewport/platform_viewport_mac.mm
deleted file mode 100644
index a74b6baf5e2c1b24f2299e8f98b39007c655cc3d..0000000000000000000000000000000000000000
--- a/mojo/services/native_viewport/platform_viewport_mac.mm
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/services/native_viewport/platform_viewport.h"
-
-#import <AppKit/NSApplication.h>
-#import <AppKit/NSView.h>
-#import <AppKit/NSWindow.h>
-
-#include "base/bind.h"
-#include "ui/gfx/rect.h"
-
-namespace mojo {
-
-class PlatformViewportMac : public PlatformViewport {
- public:
- PlatformViewportMac(Delegate* delegate)
- : delegate_(delegate),
- window_(nil) {
- }
-
- ~PlatformViewportMac() override {
- [window_ orderOut:nil];
- [window_ close];
- }
-
- private:
- // Overridden from PlatformViewport:
- void Init(const gfx::Rect& bounds) override {
- [NSApplication sharedApplication];
-
- rect_ = bounds;
- window_ = [[NSWindow alloc]
- initWithContentRect:NSRectFromCGRect(rect_.ToCGRect())
- styleMask:NSTitledWindowMask
- backing:NSBackingStoreBuffered
- defer:NO];
- delegate_->OnAcceleratedWidgetAvailable([window_ contentView]);
- delegate_->OnBoundsChanged(rect_);
- }
-
- void Show() override { [window_ orderFront:nil]; }
-
- void Hide() override { [window_ orderOut:nil]; }
-
- void Close() override {
- // TODO(beng): perform this in response to NSWindow destruction.
- delegate_->OnDestroyed();
- }
-
- gfx::Size GetSize() override { return rect_.size(); }
-
- void SetBounds(const gfx::Rect& bounds) override { NOTIMPLEMENTED(); }
-
- void SetCapture() override { NOTIMPLEMENTED(); }
-
- void ReleaseCapture() override { NOTIMPLEMENTED(); }
-
- Delegate* delegate_;
- NSWindow* window_;
- gfx::Rect rect_;
-
- DISALLOW_COPY_AND_ASSIGN(PlatformViewportMac);
-};
-
-// static
-scoped_ptr<PlatformViewport> PlatformViewport::Create(Delegate* delegate) {
- return scoped_ptr<PlatformViewport>(new PlatformViewportMac(delegate)).Pass();
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/services/native_viewport/platform_viewport_headless.cc ('k') | mojo/services/native_viewport/platform_viewport_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698