OLD | NEW |
(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 MOJO_APPLICATION_MANAGER_SHELL_IMPL_H_ |
| 6 #define MOJO_APPLICATION_MANAGER_SHELL_IMPL_H_ |
| 7 |
| 8 #include "mojo/public/cpp/bindings/binding.h" |
| 9 #include "mojo/public/cpp/bindings/error_handler.h" |
| 10 #include "mojo/public/interfaces/application/application.mojom.h" |
| 11 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 12 #include "url/gurl.h" |
| 13 |
| 14 namespace mojo { |
| 15 class ApplicationManager; |
| 16 |
| 17 class ShellImpl : public Shell, public ErrorHandler { |
| 18 public: |
| 19 ShellImpl(ScopedMessagePipeHandle handle, |
| 20 ApplicationManager* manager, |
| 21 const GURL& requested_url, |
| 22 const GURL& url); |
| 23 |
| 24 ShellImpl(ShellPtr* ptr, |
| 25 ApplicationManager* manager, |
| 26 const GURL& requested_url, |
| 27 const GURL& url); |
| 28 |
| 29 ~ShellImpl() override; |
| 30 |
| 31 void ConnectToClient(const GURL& requestor_url, |
| 32 ServiceProviderPtr service_provider); |
| 33 |
| 34 Application* client() { return binding_.client(); } |
| 35 const GURL& url() const { return url_; } |
| 36 const GURL& requested_url() const { return requested_url_; } |
| 37 |
| 38 private: |
| 39 ShellImpl(ApplicationManager* manager, |
| 40 const GURL& requested_url, |
| 41 const GURL& url); |
| 42 |
| 43 // Shell implementation: |
| 44 void ConnectToApplication( |
| 45 const String& app_url, |
| 46 InterfaceRequest<ServiceProvider> in_service_provider) override; |
| 47 |
| 48 // ErrorHandler implementation: |
| 49 void OnConnectionError() override; |
| 50 |
| 51 ApplicationManager* const manager_; |
| 52 const GURL requested_url_; |
| 53 const GURL url_; |
| 54 Binding<Shell> binding_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ShellImpl); |
| 57 }; |
| 58 |
| 59 } // namespace mojo |
| 60 |
| 61 #endif // MOJO_APPLICATION_MANAGER_SHELL_IMPL_H_ |
OLD | NEW |