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

Unified Diff: components/framelet/browser/framelet_factory_impl.h

Issue 1602663003: Framelet Prototype 2016 using Mojo IPC Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Disabled oilpan Created 4 years, 11 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 | « components/framelet/browser/DEPS ('k') | components/framelet/browser/framelet_factory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/framelet/browser/framelet_factory_impl.h
diff --git a/components/framelet/browser/framelet_factory_impl.h b/components/framelet/browser/framelet_factory_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..418c25805ad5db8b7c4bdf63f3bc5e6db4920f77
--- /dev/null
+++ b/components/framelet/browser/framelet_factory_impl.h
@@ -0,0 +1,61 @@
+// 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 COMPONENTS_FRAMELET_BROWSER_FRAMELET_FACTORY_IMPL_H_
+#define COMPONENTS_FRAMELET_BROWSER_FRAMELET_FACTORY_IMPL_H_
+
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+#include "components/framelet/common/framelet.mojom.h"
+#include "components/guest_view/browser/guest_view_manager_delegate.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+
+namespace content {
+class RenderFrameHost;
+class WebContents;
+}
+
+namespace guest_view {
+class GuestViewManager;
+}
+
+namespace framelet {
+
+class FrameletFactoryImpl : public mojom::FrameletFactory {
+ public:
+ using CreateGuestViewManagerDelegate =
+ base::Callback<guest_view::GuestViewManagerDelegate*()>;
+
+ FrameletFactoryImpl(content::WebContents* owner_web_contents,
+ const CreateGuestViewManagerDelegate& create_delegate,
+ mojo::InterfaceRequest<FrameletFactory> factory_request);
+ ~FrameletFactoryImpl() override;
+
+ static void CreateService(
+ content::RenderFrameHost* render_frame_host,
+ const CreateGuestViewManagerDelegate& create_delegate,
+ mojo::InterfaceRequest<FrameletFactory> factory_request);
+
+ private:
+ guest_view::GuestViewManager* GetOrCreateGuestViewManager();
+
+ static void FrameletCreatedCallback(
+ mojo::InterfaceRequest<mojom::Framelet> framelet,
+ content::WebContents* guest_web_contents);
+
+ // FrameletFactory
+ void Create(mojo::InterfaceRequest<mojom::Framelet> request,
+ mojo::Map<mojo::String, mojom::ValuePtr> params) override;
+
+ content::WebContents* const owner_web_contents_;
+ CreateGuestViewManagerDelegate create_delegate_;
+ mojo::StrongBinding<mojom::FrameletFactory> binding_;
+ base::WeakPtrFactory<FrameletFactoryImpl> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameletFactoryImpl);
+};
+
+} // namespace framelet
+
+#endif // COMPONENTS_FRAMELET_BROWSER_FRAMELET_FACTORY_IMPL_H_
« no previous file with comments | « components/framelet/browser/DEPS ('k') | components/framelet/browser/framelet_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698