OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ |
6 #define BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ | 6 #define BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 | 12 |
13 #include "base/containers/small_map.h" | 13 #include "base/containers/small_map.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "blimp/client/blimp_client_export.h" | |
16 #include "blimp/net/blimp_message_processor.h" | 15 #include "blimp/net/blimp_message_processor.h" |
17 #include "blimp/net/input_message_generator.h" | 16 #include "blimp/net/input_message_generator.h" |
18 | 17 |
19 namespace blink { | 18 namespace blink { |
20 class WebGestureEvent; | 19 class WebGestureEvent; |
21 } | 20 } |
22 | 21 |
23 namespace cc { | 22 namespace cc { |
24 namespace proto { | 23 namespace proto { |
25 class CompositorMessage; | 24 class CompositorMessage; |
26 } | 25 } |
27 } | 26 } |
28 | 27 |
29 namespace blimp { | 28 namespace blimp { |
30 class RenderWidgetMessage; | 29 class RenderWidgetMessage; |
31 class CompositorMessage; | 30 class CompositorMessage; |
32 | 31 |
33 namespace client { | 32 namespace client { |
34 | 33 |
35 // Handles all incoming and outgoing protobuf message types tied to a specific | 34 // Handles all incoming and outgoing protobuf message types tied to a specific |
36 // RenderWidget. This includes BlimpMessage::INPUT, BlimpMessage::COMPOSITOR, | 35 // RenderWidget. This includes BlimpMessage::INPUT, BlimpMessage::COMPOSITOR, |
37 // and BlimpMessage::RENDER_WIDGET messages. Delegates can be added to be | 36 // and BlimpMessage::RENDER_WIDGET messages. Delegates can be added to be |
38 // notified of incoming messages. This class automatically attaches a specific | 37 // notified of incoming messages. This class automatically attaches a specific |
39 // id so that the engine can drop stale RenderWidget related messages after it | 38 // id so that the engine can drop stale RenderWidget related messages after it |
40 // sends a RenderWidgetMessage::INITIALIZE message. | 39 // sends a RenderWidgetMessage::INITIALIZE message. |
41 class BLIMP_CLIENT_EXPORT RenderWidgetFeature : public BlimpMessageProcessor { | 40 class RenderWidgetFeature : public BlimpMessageProcessor { |
42 public: | 41 public: |
43 // A delegate to be notified of specific RenderWidget related incoming events. | 42 // A delegate to be notified of specific RenderWidget related incoming events. |
44 class RenderWidgetFeatureDelegate { | 43 class RenderWidgetFeatureDelegate { |
45 public: | 44 public: |
46 virtual void OnRenderWidgetCreated(int render_widget_id) = 0; | 45 virtual void OnRenderWidgetCreated(int render_widget_id) = 0; |
47 | 46 |
48 // Called when the engine's RenderWidget has changed for a particular | 47 // Called when the engine's RenderWidget has changed for a particular |
49 // WebContents. When this is received all state related to the existing | 48 // WebContents. When this is received all state related to the existing |
50 // client RenderWidget should be reset. | 49 // client RenderWidget should be reset. |
51 virtual void OnRenderWidgetInitialized(int render_widget_id) = 0; | 50 virtual void OnRenderWidgetInitialized(int render_widget_id) = 0; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // Used to send BlimpMessage::COMPOSITOR messages to the engine. | 116 // Used to send BlimpMessage::COMPOSITOR messages to the engine. |
118 std::unique_ptr<BlimpMessageProcessor> outgoing_compositor_message_processor_; | 117 std::unique_ptr<BlimpMessageProcessor> outgoing_compositor_message_processor_; |
119 | 118 |
120 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFeature); | 119 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFeature); |
121 }; | 120 }; |
122 | 121 |
123 } // namespace client | 122 } // namespace client |
124 } // namespace blimp | 123 } // namespace blimp |
125 | 124 |
126 #endif // BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ | 125 #endif // BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ |
OLD | NEW |