Index: content/browser/mojo_shell_context_impl.h |
diff --git a/content/browser/mojo_shell_context_impl.h b/content/browser/mojo_shell_context_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ef241bb73ef691851b4bd0b0a9ba460c2edb3cd9 |
--- /dev/null |
+++ b/content/browser/mojo_shell_context_impl.h |
@@ -0,0 +1,55 @@ |
+// 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 CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_ |
+#define CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_ |
+ |
+#include "base/bind.h" |
+#include "base/macros.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "content/public/browser/mojo_shell_context.h" |
+#include "mojo/shell/application_manager.h" |
+#include "url/gurl.h" |
+ |
+namespace mojo { |
+ |
+class ApplicationDelegate; |
+ |
+namespace shell { |
+class ApplicationLoader; |
+} // namespace shell |
+ |
+} // namespace mojo |
+ |
+namespace content { |
+ |
+// The global Mojo shell context for content embedders. By default this will |
+// load new application instances in a utility process. A content embedder may |
+// configure the global shell by overriding |
+// |ContentBrowserClient::ConfigureMojoShell|. |
+class MojoShellContextImpl : public MojoShellContext, |
+ public mojo::shell::ApplicationManager::Delegate { |
+ public: |
+ MojoShellContextImpl(); |
+ ~MojoShellContextImpl() override; |
+ |
+ // Adds a mapping from |url| to the given |loader|, overriding the default |
+ // loader used by content's Mojo shell. |
+ void AddCustomLoader( |
+ const GURL& url, |
+ scoped_ptr<mojo::shell::ApplicationLoader> loader) override; |
+ |
+ private: |
+ // mojo::shell::ApplicationManager::Delegate: |
+ GURL ResolveMappings(const GURL& url) override; |
+ GURL ResolveMojoURL(const GURL& url) override; |
+ |
+ scoped_ptr<mojo::shell::ApplicationManager> application_manager_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MojoShellContextImpl); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_ |