| 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> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 namespace engine { | 65 namespace engine { |
| 66 | 66 |
| 67 class BlimpBrowserContext; | 67 class BlimpBrowserContext; |
| 68 class BlimpEngineConfig; | 68 class BlimpEngineConfig; |
| 69 class BlimpFocusClient; | 69 class BlimpFocusClient; |
| 70 class BlimpScreen; | 70 class BlimpScreen; |
| 71 class BlimpWindowTreeHost; | 71 class BlimpWindowTreeHost; |
| 72 class EngineNetworkComponents; | 72 class EngineNetworkComponents; |
| 73 class Tab; | 73 class Tab; |
| 74 | 74 |
| 75 class BlimpEngineSession | 75 class BlimpEngineSession : public BlimpMessageProcessor, |
| 76 : public BlimpMessageProcessor, | 76 public content::WebContentsDelegate, |
| 77 public content::WebContentsDelegate, | 77 public ui::InputMethodObserver { |
| 78 public ui::InputMethodObserver, | |
| 79 public EngineRenderWidgetFeature::RenderWidgetMessageDelegate { | |
| 80 public: | 78 public: |
| 81 using GetPortCallback = base::Callback<void(uint16_t)>; | 79 using GetPortCallback = base::Callback<void(uint16_t)>; |
| 82 | 80 |
| 83 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, | 81 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, |
| 84 net::NetLog* net_log, | 82 net::NetLog* net_log, |
| 85 BlimpEngineConfig* config, | 83 BlimpEngineConfig* config, |
| 86 SettingsManager* settings_manager); | 84 SettingsManager* settings_manager); |
| 87 ~BlimpEngineSession() override; | 85 ~BlimpEngineSession() override; |
| 88 | 86 |
| 89 // Starts the network stack on the IO thread, and sets default placeholder | 87 // Starts the network stack on the IO thread, and sets default placeholder |
| (...skipping 27 matching lines...) Expand all Loading... |
| 117 // Returns true if a new tab is created, false otherwise. | 115 // Returns true if a new tab is created, false otherwise. |
| 118 bool CreateTab(const int target_tab_id); | 116 bool CreateTab(const int target_tab_id); |
| 119 | 117 |
| 120 // Closes an existing tab, indexed by |target_tab_id|. | 118 // Closes an existing tab, indexed by |target_tab_id|. |
| 121 void CloseTab(const int target_tab_id); | 119 void CloseTab(const int target_tab_id); |
| 122 | 120 |
| 123 // Resizes screen to |size| in pixels, and updates its device pixel ratio to | 121 // Resizes screen to |size| in pixels, and updates its device pixel ratio to |
| 124 // |device_pixel_ratio|. | 122 // |device_pixel_ratio|. |
| 125 void HandleResize(float device_pixel_ratio, const gfx::Size& size); | 123 void HandleResize(float device_pixel_ratio, const gfx::Size& size); |
| 126 | 124 |
| 127 // RenderWidgetMessage handler methods. | |
| 128 // RenderWidgetMessageDelegate implementation. | |
| 129 void OnWebGestureEvent( | |
| 130 content::RenderWidgetHost* render_widget_host, | |
| 131 std::unique_ptr<blink::WebGestureEvent> event) override; | |
| 132 void OnCompositorMessageReceived( | |
| 133 content::RenderWidgetHost* render_widget_host, | |
| 134 const std::vector<uint8_t>& message) override; | |
| 135 | |
| 136 // content::WebContentsDelegate implementation. | 125 // content::WebContentsDelegate implementation. |
| 137 content::WebContents* OpenURLFromTab( | 126 content::WebContents* OpenURLFromTab( |
| 138 content::WebContents* source, | 127 content::WebContents* source, |
| 139 const content::OpenURLParams& params) override; | 128 const content::OpenURLParams& params) override; |
| 140 void AddNewContents(content::WebContents* source, | 129 void AddNewContents(content::WebContents* source, |
| 141 content::WebContents* new_contents, | 130 content::WebContents* new_contents, |
| 142 WindowOpenDisposition disposition, | 131 WindowOpenDisposition disposition, |
| 143 const gfx::Rect& initial_rect, | 132 const gfx::Rect& initial_rect, |
| 144 bool user_gesture, | 133 bool user_gesture, |
| 145 bool* was_blocked) override; | 134 bool* was_blocked) override; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // TODO(haibinlu): Support more than one tab (crbug/547231) | 221 // TODO(haibinlu): Support more than one tab (crbug/547231) |
| 233 std::unique_ptr<Tab> tab_; | 222 std::unique_ptr<Tab> tab_; |
| 234 | 223 |
| 235 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 224 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
| 236 }; | 225 }; |
| 237 | 226 |
| 238 } // namespace engine | 227 } // namespace engine |
| 239 } // namespace blimp | 228 } // namespace blimp |
| 240 | 229 |
| 241 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 230 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
| OLD | NEW |