| 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..1eb51ac78573633a604ee6af4f4e932eefb83a12
|
| --- /dev/null
|
| +++ b/content/browser/mojo_shell_context_impl.h
|
| @@ -0,0 +1,62 @@
|
| +// 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/lazy_instance.h"
|
| +#include "base/macros.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "content/public/browser/mojo_shell_context.h"
|
| +#include "content/public/common/application_registry.h"
|
| +#include "mojo/shell/application_manager.h"
|
| +
|
| +namespace content {
|
| +
|
| +class MojoShellContextImpl : public MojoShellContext,
|
| + public ApplicationRegistry,
|
| + public mojo::shell::ApplicationManager::Delegate {
|
| + public:
|
| + MojoShellContextImpl();
|
| + ~MojoShellContextImpl() override;
|
| +
|
| + // Connects an application at |url| and gets a handle to its exposed services.
|
| + // This is only intended for use in browser code that's not part of some Mojo
|
| + // application. May be called from any thread.
|
| + static void ConnectToApplication(
|
| + const GURL& url,
|
| + mojo::InterfaceRequest<mojo::ServiceProvider> request);
|
| +
|
| + private:
|
| + class Proxy;
|
| + friend class Proxy;
|
| +
|
| + // ApplicationRegistry:
|
| + void RegisterStaticAppForURL(const GURL& url,
|
| + const StaticAppFactory& factory) override;
|
| +
|
| + void ConnectToApplicationOnOwnThread(
|
| + const GURL& url,
|
| + mojo::InterfaceRequest<mojo::ServiceProvider> request);
|
| +
|
| + // mojo::shell::ApplicationManager::Delegate:
|
| + GURL ResolveMappings(const GURL& url) override;
|
| + GURL ResolveMojoURL(const GURL& url) override;
|
| + bool CreateFetcher(
|
| + const GURL& url,
|
| + const mojo::shell::Fetcher::FetchCallback& loader_callback) override;
|
| +
|
| + static base::LazyInstance<Proxy> proxy_;
|
| +
|
| + scoped_ptr<mojo::shell::ApplicationManager> application_manager_;
|
| +
|
| + base::WeakPtrFactory<MojoShellContextImpl> weak_factory_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(MojoShellContextImpl);
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_
|
|
|