| 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_RENDER_WIDGET_BLIMP_DOCUMENT_H_ |
| 6 #define BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/ptr_util.h" |
| 12 #include "blimp/client/core/compositor/blimp_compositor.h" |
| 13 |
| 14 namespace blimp { |
| 15 namespace client { |
| 16 |
| 17 class BlimpCompositorDependencies; |
| 18 class BlimpDocumentManager; |
| 19 |
| 20 // BlimpDocument maps to an engine side render widget. |
| 21 // 1. Is created on receiving an RenderWidgetMessage from the engine. |
| 22 // 2. Owns the BlimpCompositor instance. |
| 23 class BlimpDocument : public BlimpCompositorClient { |
| 24 public: |
| 25 BlimpDocument(int document_id, |
| 26 BlimpCompositorDependencies* compositor_dependencies, |
| 27 BlimpDocumentManager* document_manager); |
| 28 ~BlimpDocument() override; |
| 29 |
| 30 int document_id() const { return document_id_; } |
| 31 |
| 32 // Returns the compositor instance. |
| 33 BlimpCompositor* GetCompositor(); |
| 34 |
| 35 protected: |
| 36 void SetCompositorForTest(std::unique_ptr<BlimpCompositor> compositor); |
| 37 |
| 38 private: |
| 39 // BlimpCompositorClient implementation. |
| 40 void SendWebGestureEvent( |
| 41 const blink::WebGestureEvent& gesture_event) override; |
| 42 void SendCompositorMessage( |
| 43 const cc::proto::CompositorMessage& message) override; |
| 44 |
| 45 // The unique identifier for this document instance. |
| 46 const int document_id_; |
| 47 |
| 48 // The compositor instance. |
| 49 std::unique_ptr<BlimpCompositor> compositor_; |
| 50 |
| 51 // Used to send messages to the corresponding render widget on the engine. |
| 52 BlimpDocumentManager* manager_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(BlimpDocument); |
| 55 }; |
| 56 |
| 57 } // namespace client |
| 58 } // namespace blimp |
| 59 |
| 60 #endif // BLIMP_CLIENT_CORE_RENDER_WIDGET_BLIMP_DOCUMENT_H_ |
| OLD | NEW |