Add yunsik.jang@lge.com to AUTHORS
[chromium-blink-merge.git] / components / native_viewport / platform_viewport.h
blob5ab69618d8d5702e8007b7f07fd3ce0aaf892bb8
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 COMPONENTS_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_
6 #define COMPONENTS_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/mojo_services/src/input_events/public/interfaces/input_events.mojom.h"
10 #include "third_party/mojo_services/src/native_viewport/public/interfaces/native_viewport.mojom.h"
11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h"
14 namespace gfx {
15 class Rect;
18 namespace native_viewport {
20 // Encapsulation of platform-specific Viewport.
21 class PlatformViewport {
22 public:
23 class Delegate {
24 public:
25 virtual ~Delegate() {}
27 virtual void OnMetricsChanged(mojo::ViewportMetricsPtr metrics) = 0;
28 virtual void OnAcceleratedWidgetAvailable(
29 gfx::AcceleratedWidget widget) = 0;
30 virtual void OnAcceleratedWidgetDestroyed() = 0;
31 virtual bool OnEvent(mojo::EventPtr event) = 0;
32 virtual void OnDestroyed() = 0;
35 virtual ~PlatformViewport() {}
37 virtual void Init(const gfx::Rect& bounds) = 0;
38 virtual void Show() = 0;
39 virtual void Hide() = 0;
40 virtual void Close() = 0;
41 virtual gfx::Size GetSize() = 0;
42 virtual void SetBounds(const gfx::Rect& bounds) = 0;
44 static scoped_ptr<PlatformViewport> Create(Delegate* delegate);
47 } // namespace native_viewport
49 #endif // COMPONENTS_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_