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 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_
6 #define MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_
8 #include "base/memory/scoped_ptr.h"
31 class NativeViewportDelegate {
33 virtual ~NativeViewportDelegate() {}
35 virtual bool OnEvent(ui::Event* event) = 0;
36 virtual void OnDestroyed() = 0;
37 virtual void OnGLContextAvailable(gpu::gles2::GLES2Interface* gl) = 0;
38 virtual void OnGLContextLost() = 0;
39 virtual void OnResized(const gfx::Size& size) = 0;
42 // Encapsulation of platform-specific Viewport.
43 class NativeViewport {
45 virtual ~NativeViewport() {}
47 virtual void Close() = 0;
49 static scoped_ptr<NativeViewport> Create(shell::Context* context,
50 NativeViewportDelegate* delegate);
53 } // namespace services
56 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_NATIVE_VIEWPORT_H_