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

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

Issue 1403083002: [Blimp] Adds Blimp EngineSession and ClientSession skeleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: blimp/engine/browser/blimp_engine_session.h
diff --git a/blimp/engine/browser/blimp_engine_session.h b/blimp/engine/browser/blimp_engine_session.h
new file mode 100644
index 0000000000000000000000000000000000000000..88eb027b82bd4f2303699687e7c3a0c845467cf9
--- /dev/null
+++ b/blimp/engine/browser/blimp_engine_session.h
@@ -0,0 +1,82 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_
+#define BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "blimp/net/blimp_message_receiver.h"
+#include "content/public/browser/web_contents_delegate.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace content {
+class BrowserContext;
+class WebContents;
+}
+
+namespace blimp {
+
+class BlimpClientSession;
+class BlimpMessage;
+
+namespace engine {
+
+class BlimpBrowserContext;
+class BlimpScreen;
+
+class BlimpEngineSession : public BlimpMessageReceiver,
+ public content::WebContentsDelegate {
+ public:
+ explicit BlimpEngineSession(scoped_ptr<BlimpBrowserContext> browser_context);
+ ~BlimpEngineSession() override;
+
+ void Initialize();
+
+ BlimpBrowserContext* browser_context() { return browser_context_.get(); }
+
+ void AttachClientSession(scoped_ptr<BlimpClientSession> client_session);
+
+ private:
+ // Creates a new WebContents and navigates to the |url|.
+ // The newly created WebContents will have the client screen size.
+ void CreateWebContents(const GURL& url);
Kevin M 2015/10/15 17:14:03 It feels strange that NEW_TAB is so conflated with
+
+ // BlimpMessageReceiver implementation.
+ net::Error OnBlimpMessage(const BlimpMessage& message) override;
+
+ // content::WebContentsDelegate implementation.
+ content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) override;
+ void AddNewContents(content::WebContents* source,
+ content::WebContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_rect,
+ bool user_gesture,
+ bool* was_blocked) override;
+ void RequestToLockMouse(content::WebContents* web_contents,
+ bool user_gesture,
+ bool last_unlocked_by_target) override;
+ void CloseContents(content::WebContents* source) override;
+ void ActivateContents(content::WebContents* contents) override;
+ void DeactivateContents(content::WebContents* contents) override;
+
+ // Sets up and owns |new_contents|.
+ void PlatformSetContents(content::WebContents* new_contents);
+
+ scoped_ptr<BlimpBrowserContext> browser_context_;
+ scoped_ptr<BlimpScreen> screen_;
+ ScopedVector<content::WebContents> contents_list_;
+
+ // Currently attached client session.
+ scoped_ptr<BlimpClientSession> client_session_;
+ DISALLOW_COPY_AND_ASSIGN(BlimpEngineSession);
+};
+
+} // namespace engine
+} // namespace blimp
+
+#endif // BLIMP_ENGINE_BROWSER_BLIMP_ENGINE_SESSION_H_

Powered by Google App Engine
This is Rietveld 408576698