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_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 5 #ifndef BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
6 #define BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 6 #define BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "blimp/common/proto/blimp_message.pb.h" | 14 #include "blimp/common/proto/blimp_message.pb.h" |
15 #include "blimp/engine/feature/engine_render_widget_feature.h" | 15 #include "blimp/engine/feature/engine_render_widget_feature.h" |
16 #include "blimp/engine/feature/engine_settings_feature.h" | 16 #include "blimp/engine/feature/engine_settings_feature.h" |
| 17 #include "blimp/engine/feature/geolocation/engine_geolocation_feature.h" |
17 #include "blimp/net/blimp_message_processor.h" | 18 #include "blimp/net/blimp_message_processor.h" |
18 #include "blimp/net/connection_error_observer.h" | 19 #include "blimp/net/connection_error_observer.h" |
19 #include "content/public/browser/invalidate_type.h" | 20 #include "content/public/browser/invalidate_type.h" |
20 #include "content/public/browser/web_contents_delegate.h" | 21 #include "content/public/browser/web_contents_delegate.h" |
21 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
22 #include "ui/base/ime/input_method_observer.h" | 23 #include "ui/base/ime/input_method_observer.h" |
23 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
24 | 25 |
25 namespace aura { | 26 namespace aura { |
26 class WindowTreeHost; | 27 class WindowTreeHost; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // values for e.g. screen size pending real values being supplied by the | 89 // values for e.g. screen size pending real values being supplied by the |
89 // client. | 90 // client. |
90 void Initialize(); | 91 void Initialize(); |
91 | 92 |
92 BlimpBrowserContext* browser_context() { return browser_context_.get(); } | 93 BlimpBrowserContext* browser_context() { return browser_context_.get(); } |
93 | 94 |
94 BlobChannelSender* blob_channel_sender() { | 95 BlobChannelSender* blob_channel_sender() { |
95 return blob_channel_sender_.get(); | 96 return blob_channel_sender_.get(); |
96 } | 97 } |
97 | 98 |
| 99 EngineGeolocationFeature* GetGeolocationFeature(); |
| 100 |
98 // Gets Engine's listening port. Invokes callback with the allocated port. | 101 // Gets Engine's listening port. Invokes callback with the allocated port. |
99 void GetEnginePortForTesting(const GetPortCallback& callback); | 102 void GetEnginePortForTesting(const GetPortCallback& callback); |
100 | 103 |
101 // BlimpMessageProcessor implementation. | 104 // BlimpMessageProcessor implementation. |
102 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly. | 105 // This object handles incoming TAB_CONTROL and NAVIGATION messages directly. |
103 void ProcessMessage(std::unique_ptr<BlimpMessage> message, | 106 void ProcessMessage(std::unique_ptr<BlimpMessage> message, |
104 const net::CompletionCallback& callback) override; | 107 const net::CompletionCallback& callback) override; |
105 | 108 |
106 private: | 109 private: |
107 // Creates ThreadPipeManager, registers features, and then starts to accept | 110 // Creates ThreadPipeManager, registers features, and then starts to accept |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // including INPUT, COMPOSITOR and RENDER_WIDGET messages. | 200 // including INPUT, COMPOSITOR and RENDER_WIDGET messages. |
198 EngineRenderWidgetFeature render_widget_feature_; | 201 EngineRenderWidgetFeature render_widget_feature_; |
199 | 202 |
200 // Sends outgoing blob data as BlimpMessages. | 203 // Sends outgoing blob data as BlimpMessages. |
201 HeliumBlobSenderDelegate* blob_delegate_; | 204 HeliumBlobSenderDelegate* blob_delegate_; |
202 | 205 |
203 // Receives image data from the renderer and sends it to the client via | 206 // Receives image data from the renderer and sends it to the client via |
204 // |blob_delegate_|. | 207 // |blob_delegate_|. |
205 std::unique_ptr<BlobChannelSender> blob_channel_sender_; | 208 std::unique_ptr<BlobChannelSender> blob_channel_sender_; |
206 | 209 |
| 210 // Handles all incoming and outgoing messages related to Geolocation. |
| 211 EngineGeolocationFeature geolocation_feature_; |
| 212 |
207 // Container for connection manager, authentication handler, and | 213 // Container for connection manager, authentication handler, and |
208 // browser connection handler. The components run on the I/O thread, and | 214 // browser connection handler. The components run on the I/O thread, and |
209 // this object is destroyed there. | 215 // this object is destroyed there. |
210 std::unique_ptr<EngineNetworkComponents> net_components_; | 216 std::unique_ptr<EngineNetworkComponents> net_components_; |
211 | 217 |
212 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; | 218 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; |
213 | 219 |
214 // Used to send TAB_CONTROL or NAVIGATION messages to client. | 220 // Used to send TAB_CONTROL or NAVIGATION messages to client. |
215 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; | 221 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; |
216 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; | 222 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; |
217 | 223 |
218 // TODO(haibinlu): Support more than one tab (crbug/547231) | 224 // TODO(haibinlu): Support more than one tab (crbug/547231) |
219 std::unique_ptr<Tab> tab_; | 225 std::unique_ptr<Tab> tab_; |
220 | 226 |
221 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 227 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
222 }; | 228 }; |
223 | 229 |
224 } // namespace engine | 230 } // namespace engine |
225 } // namespace blimp | 231 } // namespace blimp |
226 | 232 |
227 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 233 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
OLD | NEW |