Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Unified Diff: blimp/engine/session/blimp_engine_session.h

Issue 2035543002: [Blimp] Creates engine tab class to handle tab related operations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « blimp/engine/BUILD.gn ('k') | blimp/engine/session/blimp_engine_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..67570318a7b1c2617af4226cac13bf14b7bfcba2 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 Tab;
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,19 +102,16 @@ 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);
- void HandleResize(float device_pixel_ratio, const gfx::Size& size);
+ // Closes an existing tab, indexed by |target_tab_id|.
+ void CloseTab(const int target_tab_id);
- // 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);
- void Reload(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);
// RenderWidgetMessage handler methods.
// RenderWidgetMessageDelegate implementation.
@@ -158,17 +152,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);
+ // Sets up |new_contents| to be associated with the root window.
+ 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 +180,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 +201,9 @@ class BlimpEngineSession
std::unique_ptr<BlimpMessageProcessor> tab_control_message_sender_;
std::unique_ptr<BlimpMessageProcessor> navigation_message_sender_;
+ // TODO(haibinlu): Support more than one tab (crbug/547231)
+ std::unique_ptr<Tab> tab_;
+
DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession);
};
« no previous file with comments | « blimp/engine/BUILD.gn ('k') | blimp/engine/session/blimp_engine_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698