Chromium Code Reviews| Index: blimp/engine/session/blimp_engine_session.h |
| diff --git a/blimp/engine/session/blimp_engine_session.h b/blimp/engine/session/blimp_engine_session.h |
| index 2c064e59f7c8cac8b771e888c1483a01dd5b74f8..6b84023fc8419220822f5ea7a6cfba6da36a2100 100644 |
| --- a/blimp/engine/session/blimp_engine_session.h |
| +++ b/blimp/engine/session/blimp_engine_session.h |
| @@ -14,12 +14,10 @@ |
| #include "blimp/common/proto/blimp_message.pb.h" |
| #include "blimp/engine/feature/engine_render_widget_feature.h" |
| #include "blimp/engine/feature/engine_settings_feature.h" |
| -#include "blimp/engine/session/page_load_tracker.h" |
| #include "blimp/net/blimp_message_processor.h" |
| #include "blimp/net/connection_error_observer.h" |
| #include "content/public/browser/invalidate_type.h" |
| #include "content/public/browser/web_contents_delegate.h" |
| -#include "content/public/browser/web_contents_observer.h" |
| #include "net/base/completion_callback.h" |
| #include "ui/base/ime/input_method_observer.h" |
| #include "ui/gfx/geometry/size.h" |
| @@ -67,14 +65,13 @@ class BlimpFocusClient; |
| class BlimpScreen; |
| class BlimpWindowTreeHost; |
| class EngineNetworkComponents; |
| +class TabBlimp; |
| class BlimpEngineSession |
| : public BlimpMessageProcessor, |
| public content::WebContentsDelegate, |
| - public content::WebContentsObserver, |
| public ui::InputMethodObserver, |
| - public EngineRenderWidgetFeature::RenderWidgetMessageDelegate, |
| - public PageLoadTrackerClient { |
| + public EngineRenderWidgetFeature::RenderWidgetMessageDelegate { |
| public: |
| using GetPortCallback = base::Callback<void(uint16_t)>; |
| @@ -105,15 +102,18 @@ class BlimpEngineSession |
| void RegisterFeatures(); |
| // TabControlMessage handler methods. |
| - // Creates a new WebContents, which will be indexed by |target_tab_id|. |
| - // Returns true if a new WebContents is created, false otherwise. |
| - bool CreateWebContents(const int target_tab_id); |
| + // Creates a new tab, which will be indexed by |target_tab_id|. |
| + // Returns true if a new tab is created, false otherwise. |
| + bool CreateTab(const int target_tab_id); |
| - void CloseWebContents(const int target_tab_id); |
| + // Closes an existing tab, indexed by |target_tab_id|. |
| + void CloseTab(const int target_tab_id); |
| + |
| + // Resizes screen to |size| in pixels, and updates its device pixel ratio to |
| + // |device_pixel_ratio|. |
| void HandleResize(float device_pixel_ratio, const gfx::Size& size); |
| // NavigationMessage handler methods. |
| - // Navigates the target tab to the |url|. |
| void LoadUrl(const int target_tab_id, const GURL& url); |
| void GoBack(const int target_tab_id); |
| void GoForward(const int target_tab_id); |
| @@ -158,17 +158,9 @@ class BlimpEngineSession |
| void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; |
| void OnShowImeIfNeeded() override; |
| - // content::WebContentsObserver implementation. |
| - void RenderViewCreated(content::RenderViewHost* render_view_host) override; |
| - void RenderViewHostChanged(content::RenderViewHost* old_host, |
| - content::RenderViewHost* new_host) override; |
| - void RenderViewDeleted(content::RenderViewHost* render_view_host) override; |
| - |
| - // PageLoadTrackerClient implementation. |
| - void SendPageLoadStatusUpdate(PageLoadStatus load_status) override; |
| - |
| // Sets up and owns |new_contents|. |
| - void PlatformSetContents(std::unique_ptr<content::WebContents> new_contents); |
| + void PlatformSetContents(std::unique_ptr<content::WebContents> new_contents, |
| + const int target_tab_id); |
| // Presents the client's single screen. |
| // Screen should be deleted after browser context (crbug.com/613372). |
| @@ -194,13 +186,6 @@ class BlimpEngineSession |
| // Used to attach null-parented windows (e.g. popups) to the root window. |
| std::unique_ptr<aura::client::WindowTreeClient> window_tree_client_; |
| - // Only one web_contents is supported for blimp 0.5 |
| - std::unique_ptr<content::WebContents> web_contents_; |
| - |
| - // Tracks the page load status for a tab. Each PageLoadTracker is tied to a |
| - // WebContents. |
| - std::unique_ptr<PageLoadTracker> page_load_tracker_; |
| - |
| // Manages all global settings for the engine session. |
| SettingsManager* settings_manager_; |
| @@ -222,6 +207,9 @@ class BlimpEngineSession |
| std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_; |
| std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_; |
| + // Only one tab is supported for blimp 0.5. |
|
Kevin M
2016/06/06 21:44:38
Reference a bug?
Kevin M
2016/06/06 21:54:58
Also, we should probably not specify release miles
haibinlu
2016/06/06 22:32:28
Done.
|
| + std::unique_ptr<TabBlimp> tab_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession); |
| }; |