Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 #ifndef BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ | |
| 6 #define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/gfx/native_widget_types.h" | |
| 10 | |
| 11 namespace cc { | |
| 12 class Layer; | |
| 13 } // namespace cc | |
| 14 | |
| 15 namespace gfx { | |
| 16 class Size; | |
| 17 } // namespace gfx | |
| 18 | |
| 19 namespace ui { | |
| 20 class MotionEvent; | |
| 21 } | |
| 22 | |
| 23 namespace blimp { | |
| 24 namespace client { | |
| 25 | |
| 26 // A BlimpContentsView exposes the classes required to visually represent a | |
| 27 // BlimpContents (gfx::NativeView and cc::Layer). It also exposes methods that | |
| 28 // let the embedder interact with the page content. | |
| 29 class BlimpContentsView { | |
| 30 public: | |
|
Khushal
2016/09/13 04:47:24
Add a virtual dtor or this could leak memory.
David Trainor- moved to gerrit
2016/09/13 06:18:04
Ah good catch thanks!
| |
| 31 // Returns the platform specific NativeView that represents the contents of | |
| 32 // this BlimpContents. | |
| 33 virtual gfx::NativeView GetNativeView() = 0; | |
| 34 | |
| 35 // Returns the CC Layer that represents the contents of this BlimpContents. | |
| 36 // This can be used instead of |GetNativeView()| if only the CC Layer is | |
| 37 // required. | |
| 38 virtual scoped_refptr<cc::Layer> GetLayer() = 0; | |
| 39 | |
| 40 // Called to set both the size and the scale of the BlimpContents. |size| is | |
| 41 // in pixels and |device_scale_factor| is in terms of dp to px. | |
| 42 virtual void SetSizeAndScale(const gfx::Size& size, | |
| 43 float device_scale_factor) = 0; | |
| 44 | |
| 45 // Called to pass a ui::MotionEvent to the BlimpContents. Returns whether or | |
| 46 // not |motion_event| was handled. | |
| 47 virtual bool OnTouchEvent(const ui::MotionEvent& motion_event) = 0; | |
| 48 | |
| 49 protected: | |
| 50 BlimpContentsView() = default; | |
|
Khushal
2016/09/13 04:47:24
Is this necessary?
David Trainor- moved to gerrit
2016/09/13 06:18:04
Apparently :/.
Khushal
2016/09/13 23:47:10
Really? A lot of our other interfaces don't have c
| |
| 51 | |
| 52 private: | |
| 53 DISALLOW_COPY_AND_ASSIGN(BlimpContentsView); | |
| 54 }; | |
| 55 | |
| 56 } // namespace client | |
| 57 } // namespace blimp | |
| 58 | |
| 59 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ | |
| OLD | NEW |