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

Side by Side Diff: content/browser/mojo_shell_context_impl.h

Issue 1128453004: Embed a simple Mojo shell in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_
6 #define CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_
7
8 #include "base/bind.h"
9 #include "base/macros.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/mojo_shell_context.h"
12 #include "mojo/shell/application_manager.h"
13 #include "url/gurl.h"
14
15 namespace mojo {
16
17 class ApplicationDelegate;
18
19 namespace shell {
20 class ApplicationLoader;
21 } // namespace shell
22
23 } // namespace mojo
24
25 namespace content {
26
27 // The global Mojo shell context for content embedders. By default this will
28 // load new application instances in a utility process. A content embedder may
29 // configure the global shell by overriding
30 // |ContentBrowserClient::ConfigureMojoShell|.
31 class MojoShellContextImpl : public MojoShellContext,
32 public mojo::shell::ApplicationManager::Delegate {
33 public:
34 MojoShellContextImpl();
35 ~MojoShellContextImpl() override;
36
37 // Adds a mapping from |url| to the given |loader|, overriding the default
38 // loader used by content's Mojo shell.
39 void AddCustomLoader(
40 const GURL& url,
41 scoped_ptr<mojo::shell::ApplicationLoader> loader) override;
42
43 private:
44 // mojo::shell::ApplicationManager::Delegate:
45 GURL ResolveMappings(const GURL& url) override;
46 GURL ResolveMojoURL(const GURL& url) override;
47
48 scoped_ptr<mojo::shell::ApplicationManager> application_manager_;
49
50 DISALLOW_COPY_AND_ASSIGN(MojoShellContextImpl);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_BROWSER_MOJO_SHELL_CONTEXT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698