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

Side by Side Diff: shell/application_manager/shell_impl.h

Issue 943053003: Simple multi-url support for mojo apps (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
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 enum QueryHandlingBehavior {
qsr 2015/02/27 15:01:41 Can you comment on this, and on what behavior it d
Aaron Boodman 2015/02/27 16:54:44 removed.
20 SHELL_DOES_NOT_HANDLE_QUERY,
21 SHELL_HANDLES_QUERY,
22 };
23
19 ShellImpl(ApplicationPtr application, 24 ShellImpl(ApplicationPtr application,
20 ApplicationManager* manager, 25 ApplicationManager* manager,
21 const GURL& requested_url, 26 const GURL& requested_url,
22 const GURL& url); 27 const GURL& url,
28 QueryHandlingBehavior query_behavior);
23 29
24 ~ShellImpl() override; 30 ~ShellImpl() override;
25 31
26 void InitializeApplication(Array<String> args); 32 void InitializeApplication(Array<String> args);
27 33
28 void ConnectToClient(const GURL& requestor_url, 34 void ConnectToClient(const GURL& requested_url,
35 const GURL& requestor_url,
29 InterfaceRequest<ServiceProvider> services, 36 InterfaceRequest<ServiceProvider> services,
30 ServiceProviderPtr exposed_services); 37 ServiceProviderPtr exposed_services);
31 38
32 Application* application() { return application_.get(); } 39 Application* application() { return application_.get(); }
33 const GURL& url() const { return url_; } 40 const GURL& url() const { return url_; }
34 const GURL& requested_url() const { return requested_url_; } 41 const GURL& requested_url() const { return requested_url_; }
42 bool handles_query() const { return handles_query_; }
qsr 2015/02/27 15:01:41 As discussed offline, this is not necessary.
Aaron Boodman 2015/02/27 16:54:44 agree, done.
35 43
36 private: 44 private:
37 // Shell implementation: 45 // Shell implementation:
38 void ConnectToApplication(const String& app_url, 46 void ConnectToApplication(const String& app_url,
39 InterfaceRequest<ServiceProvider> services, 47 InterfaceRequest<ServiceProvider> services,
40 ServiceProviderPtr exposed_services) override; 48 ServiceProviderPtr exposed_services) override;
41 49
42 // ErrorHandler implementation: 50 // ErrorHandler implementation:
43 void OnConnectionError() override; 51 void OnConnectionError() override;
44 52
45 ApplicationManager* const manager_; 53 ApplicationManager* const manager_;
46 const GURL requested_url_; 54 const GURL requested_url_;
47 const GURL url_; 55 const GURL url_;
48 ApplicationPtr application_; 56 ApplicationPtr application_;
49 Binding<Shell> binding_; 57 Binding<Shell> binding_;
50 58
59 // If true, this shell will handle connections to url_ with any querystring.
60 bool handles_query_;
61
51 DISALLOW_COPY_AND_ASSIGN(ShellImpl); 62 DISALLOW_COPY_AND_ASSIGN(ShellImpl);
52 }; 63 };
53 64
54 } // namespace mojo 65 } // namespace mojo
55 66
56 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_ 67 #endif // SHELL_APPLICATION_MANAGER_SHELL_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698