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
3 // found in the LICENSE file.
5 #include "mojo/services/native_viewport/native_viewport.h"
10 class NativeViewportX11 : public NativeViewport {
12 NativeViewportX11(NativeViewportDelegate* delegate)
13 : delegate_(delegate) {
15 virtual ~NativeViewportX11() {
19 // Overridden from NativeViewport:
20 virtual void Close() OVERRIDE {
21 // TODO(beng): perform this in response to XWindow destruction.
22 delegate_->OnDestroyed();
25 NativeViewportDelegate* delegate_;
27 DISALLOW_COPY_AND_ASSIGN(NativeViewportX11);
31 scoped_ptr<NativeViewport> NativeViewport::Create(
32 shell::Context* context,
33 NativeViewportDelegate* delegate) {
34 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass();
37 } // namespace services