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 "shell/application_manager/identity.h" |
12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
13 | 14 |
14 namespace mojo { | 15 namespace mojo { |
15 namespace shell { | 16 namespace shell { |
16 | 17 |
17 class ApplicationManager; | 18 class ApplicationManager; |
18 | 19 |
19 class ShellImpl : public Shell, public ErrorHandler { | 20 class ShellImpl : public Shell, public ErrorHandler { |
20 public: | 21 public: |
21 ShellImpl(ApplicationPtr application, | 22 ShellImpl(ApplicationPtr application, |
22 ApplicationManager* manager, | 23 ApplicationManager* manager, |
23 // The original URL that was first requested, before any resolution. | 24 // The original URL that was first requested, before any resolution. |
24 const GURL& original_url, | 25 const GURL& original_url, |
25 const GURL& resolved_url); | 26 const Identity& resolved_identity); |
26 | 27 |
27 ~ShellImpl() override; | 28 ~ShellImpl() override; |
28 | 29 |
29 void InitializeApplication(Array<String> args); | 30 void InitializeApplication(Array<String> args); |
30 | 31 |
31 void ConnectToClient(const GURL& requested_url, | 32 void ConnectToClient(const GURL& requested_url, |
32 const GURL& requestor_url, | 33 const GURL& requestor_url, |
33 InterfaceRequest<ServiceProvider> services, | 34 InterfaceRequest<ServiceProvider> services, |
34 ServiceProviderPtr exposed_services); | 35 ServiceProviderPtr exposed_services); |
35 | 36 |
36 Application* application() { return application_.get(); } | 37 Application* application() { return application_.get(); } |
37 const GURL& url() const { return url_; } | 38 const Identity& identity() const { return identity_; } |
38 const GURL& requested_url() const { return requested_url_; } | 39 const GURL& requested_url() const { return requested_url_; } |
39 | 40 |
40 private: | 41 private: |
41 // Shell implementation: | 42 // Shell implementation: |
42 void ConnectToApplication(const String& app_url, | 43 void ConnectToApplication(const String& app_url, |
43 InterfaceRequest<ServiceProvider> services, | 44 InterfaceRequest<ServiceProvider> services, |
44 ServiceProviderPtr exposed_services) override; | 45 ServiceProviderPtr exposed_services) override; |
45 | 46 |
46 // ErrorHandler implementation: | 47 // ErrorHandler implementation: |
47 void OnConnectionError() override; | 48 void OnConnectionError() override; |
48 | 49 |
49 ApplicationManager* const manager_; | 50 ApplicationManager* const manager_; |
50 const GURL requested_url_; | 51 const GURL requested_url_; |
51 const GURL url_; | 52 const Identity identity_; |
52 ApplicationPtr application_; | 53 ApplicationPtr application_; |
53 Binding<Shell> binding_; | 54 Binding<Shell> binding_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(ShellImpl); | 56 DISALLOW_COPY_AND_ASSIGN(ShellImpl); |
56 }; | 57 }; |
57 | 58 |
58 } // namespace shell | 59 } // namespace shell |
59 } // namespace mojo | 60 } // namespace mojo |
60 | 61 |
61 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ | 62 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ |
OLD | NEW |