OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ |
6 #define SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ | 6 #define SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ |
7 | 7 |
8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
9 #include "mojo/public/cpp/bindings/error_handler.h" | 9 #include "mojo/public/cpp/bindings/error_handler.h" |
10 #include "mojo/public/interfaces/application/application.mojom.h" | 10 #include "mojo/public/interfaces/application/application.mojom.h" |
11 #include "mojo/public/interfaces/application/shell.mojom.h" | 11 #include "mojo/public/interfaces/application/shell.mojom.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class ApplicationManager; | 15 class ApplicationManager; |
16 | 16 |
17 class ShellImpl : public Shell, public ErrorHandler { | 17 class ShellImpl : public Shell, public ErrorHandler { |
18 public: | 18 public: |
19 ShellImpl(ApplicationPtr application, | 19 ShellImpl(ApplicationPtr application, |
20 ApplicationManager* manager, | 20 ApplicationManager* manager, |
21 const GURL& requested_url, | 21 const GURL& requested_url, |
22 const GURL& url); | 22 const GURL& url); |
23 | 23 |
24 ~ShellImpl() override; | 24 ~ShellImpl() override; |
25 | 25 |
26 void InitializeApplication(Array<String> args); | 26 void InitializeApplication(Array<String> args); |
27 | 27 |
28 void ConnectToClient(const GURL& requestor_url, | 28 void ConnectToClient(const GURL& requested_url, |
| 29 const GURL& requestor_url, |
29 InterfaceRequest<ServiceProvider> services, | 30 InterfaceRequest<ServiceProvider> services, |
30 ServiceProviderPtr exposed_services); | 31 ServiceProviderPtr exposed_services); |
31 | 32 |
32 Application* application() { return application_.get(); } | 33 Application* application() { return application_.get(); } |
33 const GURL& url() const { return url_; } | 34 const GURL& url() const { return url_; } |
34 const GURL& requested_url() const { return requested_url_; } | 35 const GURL& requested_url() const { return requested_url_; } |
35 | 36 |
36 private: | 37 private: |
37 // Shell implementation: | 38 // Shell implementation: |
38 void ConnectToApplication(const String& app_url, | 39 void ConnectToApplication(const String& app_url, |
39 InterfaceRequest<ServiceProvider> services, | 40 InterfaceRequest<ServiceProvider> services, |
40 ServiceProviderPtr exposed_services) override; | 41 ServiceProviderPtr exposed_services) override; |
41 | 42 |
42 // ErrorHandler implementation: | 43 // ErrorHandler implementation: |
43 void OnConnectionError() override; | 44 void OnConnectionError() override; |
44 | 45 |
45 ApplicationManager* const manager_; | 46 ApplicationManager* const manager_; |
46 const GURL requested_url_; | 47 const GURL requested_url_; |
47 const GURL url_; | 48 const GURL url_; |
48 ApplicationPtr application_; | 49 ApplicationPtr application_; |
49 Binding<Shell> binding_; | 50 Binding<Shell> binding_; |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(ShellImpl); | 52 DISALLOW_COPY_AND_ASSIGN(ShellImpl); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace mojo | 55 } // namespace mojo |
55 | 56 |
56 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ | 57 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ |
OLD | NEW |