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> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Sends a WebInputEvent for |tab_id| to the engine. | 67 // Sends a WebInputEvent for |tab_id| to the engine. |
68 void SendInputEvent(const int tab_id, const blink::WebInputEvent& event); | 68 void SendInputEvent(const int tab_id, const blink::WebInputEvent& event); |
69 | 69 |
70 // Sends a CompositorMessage for |tab_id| to the engine. | 70 // Sends a CompositorMessage for |tab_id| to the engine. |
71 void SendCompositorMessage(const int tab_id, | 71 void SendCompositorMessage(const int tab_id, |
72 const cc::proto::CompositorMessage& message); | 72 const cc::proto::CompositorMessage& message); |
73 | 73 |
74 // Sets a RenderWidgetMessageDelegate to be notified of all incoming | 74 // Sets a RenderWidgetMessageDelegate to be notified of all incoming |
75 // RenderWidget related messages for |tab_id| from the engine. There can only | 75 // RenderWidget related messages for |tab_id| from the engine. There can only |
76 // be one RenderWidgetMessageDelegate per tab. | 76 // be one RenderWidgetMessageDelegate per tab. |
77 void SetDelegate(const int tab_id, RenderWidgetFeatureDelegate* delegate); | 77 // virtual for testing. |
78 void RemoveDelegate(const int tab_id); | 78 virtual void SetDelegate(int tab_id, RenderWidgetFeatureDelegate* delegate); |
| 79 virtual void RemoveDelegate(const int tab_id); |
79 | 80 |
80 private: | 81 private: |
81 // BlimpMessageProcessor implementation. | 82 // BlimpMessageProcessor implementation. |
82 void ProcessMessage(scoped_ptr<BlimpMessage> message, | 83 void ProcessMessage(scoped_ptr<BlimpMessage> message, |
83 const net::CompletionCallback& callback) override; | 84 const net::CompletionCallback& callback) override; |
84 | 85 |
85 // Returns nullptr if no delegate is found. | 86 // Returns nullptr if no delegate is found. |
86 RenderWidgetFeatureDelegate* FindDelegate(const int tab_id); | 87 RenderWidgetFeatureDelegate* FindDelegate(const int tab_id); |
87 | 88 |
88 // Returns 0 if no id is found. | 89 // Returns 0 if no id is found. |
(...skipping 14 matching lines...) Expand all Loading... |
103 // Used to send BlimpMessage::COMPOSITOR messages to the engine. | 104 // Used to send BlimpMessage::COMPOSITOR messages to the engine. |
104 scoped_ptr<BlimpMessageProcessor> outgoing_compositor_message_processor_; | 105 scoped_ptr<BlimpMessageProcessor> outgoing_compositor_message_processor_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFeature); | 107 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFeature); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace client | 110 } // namespace client |
110 } // namespace blimp | 111 } // namespace blimp |
111 | 112 |
112 #endif // BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ | 113 #endif // BLIMP_CLIENT_FEATURE_RENDER_WIDGET_FEATURE_H_ |
OLD | NEW |