Chromium Code Reviews| Index: blimp/client/public/contents/blimp_contents_view.h |
| diff --git a/blimp/client/public/contents/blimp_contents_view.h b/blimp/client/public/contents/blimp_contents_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..01bf4e65780115f7950671d79d69da3294bc5323 |
| --- /dev/null |
| +++ b/blimp/client/public/contents/blimp_contents_view.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ |
| +#define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ |
| + |
| +#include "base/macros.h" |
| +#include "ui/gfx/native_widget_types.h" |
| + |
| +namespace cc { |
| +class Layer; |
| +} // namespace cc |
| + |
| +namespace gfx { |
| +class Size; |
| +} // namespace gfx |
| + |
| +namespace ui { |
| +class MotionEvent; |
| +} |
| + |
| +namespace blimp { |
| +namespace client { |
| + |
| +// A BlimpContentsView exposes the classes required to visually represent a |
| +// BlimpContents (gfx::NativeView and cc::Layer). It also exposes methods that |
| +// let the embedder interact with the page content. |
| +class BlimpContentsView { |
| + 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!
|
| + // Returns the platform specific NativeView that represents the contents of |
| + // this BlimpContents. |
| + virtual gfx::NativeView GetNativeView() = 0; |
| + |
| + // Returns the CC Layer that represents the contents of this BlimpContents. |
| + // This can be used instead of |GetNativeView()| if only the CC Layer is |
| + // required. |
| + virtual scoped_refptr<cc::Layer> GetLayer() = 0; |
| + |
| + // Called to set both the size and the scale of the BlimpContents. |size| is |
| + // in pixels and |device_scale_factor| is in terms of dp to px. |
| + virtual void SetSizeAndScale(const gfx::Size& size, |
| + float device_scale_factor) = 0; |
| + |
| + // Called to pass a ui::MotionEvent to the BlimpContents. Returns whether or |
| + // not |motion_event| was handled. |
| + virtual bool OnTouchEvent(const ui::MotionEvent& motion_event) = 0; |
| + |
| + protected: |
| + 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
|
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(BlimpContentsView); |
| +}; |
| + |
| +} // namespace client |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_VIEW_H_ |