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

Side by Side Diff: mojo/ui/view_provider_app.h

Issue 1975253002: ApplicationConnection devolution, part 2.1. (Closed) Base URL: https://github.com/domokit/mojo.git@work792-x-work791_service_registry_spimpl
Patch Set: Created 4 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
« no previous file with comments | « mojo/ui/content_viewer_app.cc ('k') | mojo/ui/view_provider_app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 MOJO_UI_VIEW_PROVIDER_APP_H_ 5 #ifndef MOJO_UI_VIEW_PROVIDER_APP_H_
6 #define MOJO_UI_VIEW_PROVIDER_APP_H_ 6 #define MOJO_UI_VIEW_PROVIDER_APP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "mojo/common/strong_binding_set.h" 10 #include "mojo/common/strong_binding_set.h"
11 #include "mojo/public/c/system/main.h" 11 #include "mojo/public/c/system/main.h"
12 #include "mojo/public/cpp/application/application_connection.h" 12 #include "mojo/public/cpp/application/application_connection.h"
13 #include "mojo/public/cpp/application/application_impl.h" 13 #include "mojo/public/cpp/application/application_impl.h"
14 #include "mojo/public/cpp/system/macros.h" 14 #include "mojo/public/cpp/system/macros.h"
15 #include "mojo/services/ui/views/interfaces/view_provider.mojom.h" 15 #include "mojo/services/ui/views/interfaces/view_provider.mojom.h"
16 16
17 namespace mojo { 17 namespace mojo {
18 namespace ui { 18 namespace ui {
19 19
20 // Abstract implementation of a simple application that offers a ViewProvider. 20 // Abstract implementation of a simple application that offers a ViewProvider.
21 // Subclasses must provide a function to create the necessary Views. 21 // Subclasses must provide a function to create the necessary Views.
22 // 22 //
23 // It is not necessary to use this class to implement all ViewProviders. 23 // It is not necessary to use this class to implement all ViewProviders.
24 // This class is merely intended to make the simple apps easier to write. 24 // This class is merely intended to make the simple apps easier to write.
25 class ViewProviderApp : public ApplicationDelegate, 25 class ViewProviderApp : public ApplicationDelegate {
26 public InterfaceFactory<ui::ViewProvider> {
27 public: 26 public:
28 ViewProviderApp(); 27 ViewProviderApp();
29 ~ViewProviderApp() override; 28 ~ViewProviderApp() override;
30 29
31 ApplicationImpl* app_impl() { return app_impl_; } 30 ApplicationImpl* app_impl() { return app_impl_; }
32 31
33 // |ApplicationDelegate|: 32 // |ApplicationDelegate|:
34 void Initialize(ApplicationImpl* app) override; 33 void Initialize(ApplicationImpl* app) override;
35 bool ConfigureIncomingConnection(ApplicationConnection* connection) override; 34 bool ConfigureIncomingConnection(ApplicationConnection* connection) override;
36 35
(...skipping 13 matching lines...) Expand all
50 // the view from the caller. 49 // the view from the caller.
51 virtual void CreateView( 50 virtual void CreateView(
52 const std::string& view_provider_url, 51 const std::string& view_provider_url,
53 InterfaceRequest<ViewOwner> view_owner_request, 52 InterfaceRequest<ViewOwner> view_owner_request,
54 InterfaceRequest<ServiceProvider> services, 53 InterfaceRequest<ServiceProvider> services,
55 InterfaceHandle<ServiceProvider> exposed_services) = 0; 54 InterfaceHandle<ServiceProvider> exposed_services) = 0;
56 55
57 private: 56 private:
58 class DelegatingViewProvider; 57 class DelegatingViewProvider;
59 58
60 // |InterfaceFactory<ViewProvider>|:
61 void Create(const ConnectionContext& connection_context,
62 InterfaceRequest<ViewProvider> request) override;
63
64 void CreateView(DelegatingViewProvider* provider, 59 void CreateView(DelegatingViewProvider* provider,
65 const std::string& view_provider_url, 60 const std::string& view_provider_url,
66 InterfaceRequest<ViewOwner> view_owner_request, 61 InterfaceRequest<ViewOwner> view_owner_request,
67 InterfaceRequest<ServiceProvider> services, 62 InterfaceRequest<ServiceProvider> services,
68 InterfaceHandle<ServiceProvider> exposed_services); 63 InterfaceHandle<ServiceProvider> exposed_services);
69 64
70 ApplicationImpl* app_impl_ = nullptr; 65 ApplicationImpl* app_impl_ = nullptr;
71 StrongBindingSet<ViewProvider> bindings_; 66 StrongBindingSet<ViewProvider> bindings_;
72 67
73 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewProviderApp); 68 MOJO_DISALLOW_COPY_AND_ASSIGN(ViewProviderApp);
74 }; 69 };
75 70
76 } // namespace ui 71 } // namespace ui
77 } // namespace mojo 72 } // namespace mojo
78 73
79 #endif // MOJO_UI_VIEW_PROVIDER_APP_H_ 74 #endif // MOJO_UI_VIEW_PROVIDER_APP_H_
OLDNEW
« no previous file with comments | « mojo/ui/content_viewer_app.cc ('k') | mojo/ui/view_provider_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698