Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ | 5 #ifndef MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ |
| 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ | 6 #define MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Rect; | 13 class Rect; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 class Event; | 17 class Event; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace mojo { | 20 namespace mojo { |
| 21 | 21 |
| 22 // Encapsulation of platform-specific Viewport. | 22 // Encapsulation of platform-specific Viewport. |
| 23 class PlatformViewport { | 23 class PlatformViewport { |
| 24 public: | 24 public: |
| 25 class Delegate { | 25 class Delegate { |
| 26 public: | 26 public: |
| 27 virtual ~Delegate() {} | 27 virtual ~Delegate() {} |
| 28 | 28 |
| 29 virtual void OnBoundsChanged(const gfx::Rect& size) = 0; | 29 virtual void OnBoundsChanged(const gfx::Rect& rect) = 0; |
|
jamesr
2014/09/25 22:18:14
hmm? i don't understand this change
abarth-chromium
2014/09/25 23:31:36
I renamed the formal parameter. It is a rect, not
| |
| 30 virtual void OnAcceleratedWidgetAvailable( | 30 virtual void OnAcceleratedWidgetAvailable( |
| 31 gfx::AcceleratedWidget widget) = 0; | 31 gfx::AcceleratedWidget widget) = 0; |
| 32 virtual bool OnEvent(ui::Event* ui_event) = 0; | 32 virtual bool OnEvent(ui::Event* ui_event) = 0; |
| 33 virtual void OnDestroyed() = 0; | 33 virtual void OnDestroyed() = 0; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 virtual ~PlatformViewport() {} | 36 virtual ~PlatformViewport() {} |
| 37 | 37 |
| 38 virtual void Init(const gfx::Rect& bounds) = 0; | 38 virtual void Init(const gfx::Rect& bounds) = 0; |
| 39 virtual void Show() = 0; | 39 virtual void Show() = 0; |
| 40 virtual void Hide() = 0; | 40 virtual void Hide() = 0; |
| 41 virtual void Close() = 0; | 41 virtual void Close() = 0; |
| 42 virtual gfx::Size GetSize() = 0; | 42 virtual gfx::Size GetSize() = 0; |
| 43 virtual void SetBounds(const gfx::Rect& bounds) = 0; | 43 virtual void SetBounds(const gfx::Rect& bounds) = 0; |
| 44 | 44 |
| 45 virtual void SetCapture() = 0; | 45 virtual void SetCapture() = 0; |
| 46 virtual void ReleaseCapture() = 0; | 46 virtual void ReleaseCapture() = 0; |
| 47 | 47 |
| 48 static scoped_ptr<PlatformViewport> Create(Delegate* delegate); | 48 static scoped_ptr<PlatformViewport> Create(Delegate* delegate); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace mojo | 51 } // namespace mojo |
| 52 | 52 |
| 53 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ | 53 #endif // MOJO_SERVICES_NATIVE_VIEWPORT_PLATFORM_VIEWPORT_H_ |
| OLD | NEW |