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_PLATFORM_VIEWPORT_H_
6 #define MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/size.h"
22 // Encapsulation of platform-specific Viewport.
23 class PlatformViewport {
27 virtual ~Delegate() {}
29 virtual void OnBoundsChanged(const gfx::Rect& rect) = 0;
30 virtual void OnAcceleratedWidgetAvailable(
31 gfx::AcceleratedWidget widget) = 0;
32 virtual bool OnEvent(ui::Event* ui_event) = 0;
33 virtual void OnDestroyed() = 0;
36 virtual ~PlatformViewport() {}
38 virtual void Init(const gfx::Rect& bounds) = 0;
39 virtual void Show() = 0;
40 virtual void Hide() = 0;
41 virtual void Close() = 0;
42 virtual gfx::Size GetSize() = 0;
43 virtual void SetBounds(const gfx::Rect& bounds) = 0;
45 virtual void SetCapture() = 0;
46 virtual void ReleaseCapture() = 0;
48 static scoped_ptr<PlatformViewport> Create(Delegate* delegate);
53 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_