| 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/session/page_load_tracker.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 "content/public/browser/web_contents_observer.h" | 22 #include "content/public/browser/web_contents_observer.h" |
| 22 #include "net/base/completion_callback.h" | 23 #include "net/base/completion_callback.h" |
| 23 #include "ui/base/ime/input_method_observer.h" | 24 #include "ui/base/ime/input_method_observer.h" |
| 24 #include "ui/gfx/geometry/size.h" | 25 #include "ui/gfx/geometry/size.h" |
| 25 | 26 |
| 26 namespace aura { | 27 namespace aura { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 class BlimpFocusClient; | 66 class BlimpFocusClient; |
| 66 class BlimpScreen; | 67 class BlimpScreen; |
| 67 class BlimpWindowTreeHost; | 68 class BlimpWindowTreeHost; |
| 68 class EngineNetworkComponents; | 69 class EngineNetworkComponents; |
| 69 | 70 |
| 70 class BlimpEngineSession | 71 class BlimpEngineSession |
| 71 : public BlimpMessageProcessor, | 72 : public BlimpMessageProcessor, |
| 72 public content::WebContentsDelegate, | 73 public content::WebContentsDelegate, |
| 73 public content::WebContentsObserver, | 74 public content::WebContentsObserver, |
| 74 public ui::InputMethodObserver, | 75 public ui::InputMethodObserver, |
| 75 public EngineRenderWidgetFeature::RenderWidgetMessageDelegate { | 76 public EngineRenderWidgetFeature::RenderWidgetMessageDelegate, |
| 77 public PageLoadTrackerClient { |
| 76 public: | 78 public: |
| 77 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, | 79 BlimpEngineSession(std::unique_ptr<BlimpBrowserContext> browser_context, |
| 78 net::NetLog* net_log, | 80 net::NetLog* net_log, |
| 79 BlimpEngineConfig* config, | 81 BlimpEngineConfig* config, |
| 80 SettingsManager* settings_manager); | 82 SettingsManager* settings_manager); |
| 81 ~BlimpEngineSession() override; | 83 ~BlimpEngineSession() override; |
| 82 | 84 |
| 83 // Starts the network stack on the IO thread, and sets default placeholder | 85 // Starts the network stack on the IO thread, and sets default placeholder |
| 84 // values for e.g. screen size pending real values being supplied by the | 86 // values for e.g. screen size pending real values being supplied by the |
| 85 // client. | 87 // client. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void RequestToLockMouse(content::WebContents* web_contents, | 136 void RequestToLockMouse(content::WebContents* web_contents, |
| 135 bool user_gesture, | 137 bool user_gesture, |
| 136 bool last_unlocked_by_target) override; | 138 bool last_unlocked_by_target) override; |
| 137 void CloseContents(content::WebContents* source) override; | 139 void CloseContents(content::WebContents* source) override; |
| 138 void ActivateContents(content::WebContents* contents) override; | 140 void ActivateContents(content::WebContents* contents) override; |
| 139 void ForwardCompositorProto( | 141 void ForwardCompositorProto( |
| 140 content::RenderWidgetHost* render_widget_host, | 142 content::RenderWidgetHost* render_widget_host, |
| 141 const std::vector<uint8_t>& proto) override; | 143 const std::vector<uint8_t>& proto) override; |
| 142 void NavigationStateChanged(content::WebContents* source, | 144 void NavigationStateChanged(content::WebContents* source, |
| 143 content::InvalidateTypes changed_flags) override; | 145 content::InvalidateTypes changed_flags) override; |
| 144 void LoadProgressChanged(content::WebContents* source, | |
| 145 double progress) override; | |
| 146 | 146 |
| 147 // ui::InputMethodObserver overrides. | 147 // ui::InputMethodObserver overrides. |
| 148 void OnTextInputTypeChanged(const ui::TextInputClient* client) override; | 148 void OnTextInputTypeChanged(const ui::TextInputClient* client) override; |
| 149 void OnFocus() override; | 149 void OnFocus() override; |
| 150 void OnBlur() override; | 150 void OnBlur() override; |
| 151 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; | 151 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; |
| 152 void OnTextInputStateChanged(const ui::TextInputClient* client) override; | 152 void OnTextInputStateChanged(const ui::TextInputClient* client) override; |
| 153 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; | 153 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; |
| 154 void OnShowImeIfNeeded() override; | 154 void OnShowImeIfNeeded() override; |
| 155 | 155 |
| 156 // content::WebContentsObserver implementation. | 156 // content::WebContentsObserver implementation. |
| 157 void RenderViewCreated(content::RenderViewHost* render_view_host) override; | 157 void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
| 158 void RenderViewHostChanged(content::RenderViewHost* old_host, | 158 void RenderViewHostChanged(content::RenderViewHost* old_host, |
| 159 content::RenderViewHost* new_host) override; | 159 content::RenderViewHost* new_host) override; |
| 160 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; | 160 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; |
| 161 void DidStartProvisionalLoadForFrame( |
| 162 content::RenderFrameHost* render_frame_host, |
| 163 const GURL& validated_url, |
| 164 bool is_error_page, |
| 165 bool is_iframe_srcdoc) override; |
| 166 void DidFinishLoad(content::RenderFrameHost* render_frame_host, |
| 167 const GURL& validated_url) override; |
| 168 void DidFailLoad(content::RenderFrameHost* render_frame_host, |
| 169 const GURL& validated_url, |
| 170 int error_code, |
| 171 const base::string16& error_description, |
| 172 bool was_ignored_by_handler) override; |
| 173 void DidFirstPaintAfterLoad( |
| 174 content::RenderWidgetHost* render_widget_host) override; |
| 175 |
| 176 // PageLoadTrackerClient implementation. |
| 177 void SendPageLoadStatusUpdate(bool load_status) override; |
| 161 | 178 |
| 162 // Sets up and owns |new_contents|. | 179 // Sets up and owns |new_contents|. |
| 163 void PlatformSetContents(std::unique_ptr<content::WebContents> new_contents); | 180 void PlatformSetContents(std::unique_ptr<content::WebContents> new_contents); |
| 164 | 181 |
| 165 // Stores the value of the last page load completed update sent to the client. | |
| 166 // This field is used per tab. | |
| 167 bool last_page_load_completed_value_; | |
| 168 | |
| 169 // Content BrowserContext for this session. | 182 // Content BrowserContext for this session. |
| 170 std::unique_ptr<BlimpBrowserContext> browser_context_; | 183 std::unique_ptr<BlimpBrowserContext> browser_context_; |
| 171 | 184 |
| 172 // Engine configuration including assigned client token. | 185 // Engine configuration including assigned client token. |
| 173 BlimpEngineConfig* engine_config_; | 186 BlimpEngineConfig* engine_config_; |
| 174 | 187 |
| 175 // Presents the client's single screen. | 188 // Presents the client's single screen. |
| 176 std::unique_ptr<BlimpScreen> screen_; | 189 std::unique_ptr<BlimpScreen> screen_; |
| 177 | 190 |
| 178 // Represents the (currently single) browser window into which tab(s) will | 191 // Represents the (currently single) browser window into which tab(s) will |
| (...skipping 16 matching lines...) Expand all Loading... |
| 195 // Manages all global settings for the engine session. | 208 // Manages all global settings for the engine session. |
| 196 SettingsManager* settings_manager_; | 209 SettingsManager* settings_manager_; |
| 197 | 210 |
| 198 // Handles all incoming messages for type SETTINGS. | 211 // Handles all incoming messages for type SETTINGS. |
| 199 EngineSettingsFeature settings_feature_; | 212 EngineSettingsFeature settings_feature_; |
| 200 | 213 |
| 201 // Handles all incoming and outgoing messages related to RenderWidget, | 214 // Handles all incoming and outgoing messages related to RenderWidget, |
| 202 // including INPUT, COMPOSITOR and RENDER_WIDGET messages. | 215 // including INPUT, COMPOSITOR and RENDER_WIDGET messages. |
| 203 EngineRenderWidgetFeature render_widget_feature_; | 216 EngineRenderWidgetFeature render_widget_feature_; |
| 204 | 217 |
| 218 // Tracks the page load status for a tab. |
| 219 PageLoadTracker page_load_tracker_; |
| 220 |
| 205 // Container for connection manager, authentication handler, and | 221 // Container for connection manager, authentication handler, and |
| 206 // browser connection handler. The components run on the I/O thread, and | 222 // browser connection handler. The components run on the I/O thread, and |
| 207 // this object is destroyed there. | 223 // this object is destroyed there. |
| 208 std::unique_ptr<EngineNetworkComponents> net_components_; | 224 std::unique_ptr<EngineNetworkComponents> net_components_; |
| 209 | 225 |
| 210 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; | 226 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; |
| 211 | 227 |
| 212 // Used to send TAB_CONTROL or NAVIGATION messages to client. | 228 // Used to send TAB_CONTROL or NAVIGATION messages to client. |
| 213 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; | 229 std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; |
| 214 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; | 230 std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; |
| 215 | 231 |
| 216 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); | 232 DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
| 217 }; | 233 }; |
| 218 | 234 |
| 219 } // namespace engine | 235 } // namespace engine |
| 220 } // namespace blimp | 236 } // namespace blimp |
| 221 | 237 |
| 222 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ | 238 #endif // BLIMP_ENGINE_SESSION_BLIMP_ENGINE_SESSION_H_ |
| OLD | NEW |