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_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_ |
| 6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" |
| 12 #include "blimp/client/core/contents/ime_feature.h" |
| 13 #include "blimp/client/public/contents/blimp_contents_view.h" |
| 14 #include "ui/gfx/native_widget_types.h" |
| 15 |
| 16 namespace blimp { |
| 17 namespace client { |
| 18 class BlimpContentsImpl; |
| 19 |
| 20 // The internal generic implementation of a BlimpContentsView that implements |
| 21 // the common functionality shared across platforms. Meant to be overridden and |
| 22 // implemented for each supported platform. |
| 23 class BlimpContentsViewImpl : public BlimpContentsView { |
| 24 public: |
| 25 // A factory method that needs to be implemented for each supported platform. |
| 26 static std::unique_ptr<BlimpContentsViewImpl> Create( |
| 27 BlimpContentsImpl* blimp_contents, |
| 28 scoped_refptr<cc::Layer> contents_layer); |
| 29 |
| 30 virtual ~BlimpContentsViewImpl(); |
| 31 |
| 32 // Exposes the plaform specific ImeFeature::Delegate. This should handle text |
| 33 // input requests and present them to the user. |
| 34 virtual ImeFeature::Delegate* GetImeDelegate() = 0; |
| 35 |
| 36 // BlimpContentsView implementation. |
| 37 scoped_refptr<cc::Layer> GetLayer() override; |
| 38 void SetSizeAndScale(const gfx::Size& size, |
| 39 float device_scale_factor) override; |
| 40 bool OnTouchEvent(const ui::MotionEvent& motion_event) override; |
| 41 |
| 42 protected: |
| 43 BlimpContentsViewImpl(BlimpContentsImpl* blimp_contents, |
| 44 scoped_refptr<cc::Layer> contents_layer); |
| 45 |
| 46 private: |
| 47 BlimpContentsImpl* blimp_contents_; |
| 48 scoped_refptr<cc::Layer> contents_layer_; |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(BlimpContentsViewImpl); |
| 51 }; |
| 52 |
| 53 } // namespace client |
| 54 } // namespace blimp |
| 55 |
| 56 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_ |
OLD | NEW |