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

Side by Side Diff: mandoline/services/core_services/core_services_application_delegate.h

Issue 1675083002: Rename ApplicationDelegate to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@delegate
Patch Set: . Created 4 years, 10 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 MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ 5 #ifndef MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_
6 #define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_ 6 #define MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "components/clipboard/public/interfaces/clipboard.mojom.h" 11 #include "components/clipboard/public/interfaces/clipboard.mojom.h"
12 #include "mojo/common/weak_binding_set.h" 12 #include "mojo/common/weak_binding_set.h"
13 #include "mojo/services/tracing/public/cpp/tracing_impl.h" 13 #include "mojo/services/tracing/public/cpp/tracing_impl.h"
14 #include "mojo/shell/public/cpp/application_delegate.h"
15 #include "mojo/shell/public/cpp/interface_factory_impl.h" 14 #include "mojo/shell/public/cpp/interface_factory_impl.h"
15 #include "mojo/shell/public/cpp/shell_client.h"
16 #include "mojo/shell/public/interfaces/content_handler.mojom.h" 16 #include "mojo/shell/public/interfaces/content_handler.mojom.h"
17 17
18 namespace core_services { 18 namespace core_services {
19 19
20 class ApplicationThread; 20 class ApplicationThread;
21 21
22 // The CoreServices application is a singleton ServiceProvider. There is one 22 // The CoreServices application is a singleton ServiceProvider. There is one
23 // instance of the CoreServices ServiceProvider. 23 // instance of the CoreServices ServiceProvider.
24 class CoreServicesApplicationDelegate 24 class CoreServicesApplicationDelegate
25 : public mojo::ApplicationDelegate, 25 : public mojo::ShellClient,
26 public mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>, 26 public mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>,
27 public mojo::shell::mojom::ContentHandler { 27 public mojo::shell::mojom::ContentHandler {
28 public: 28 public:
29 CoreServicesApplicationDelegate(); 29 CoreServicesApplicationDelegate();
30 ~CoreServicesApplicationDelegate() override; 30 ~CoreServicesApplicationDelegate() override;
31 31
32 void ApplicationThreadDestroyed(ApplicationThread* thread); 32 void ApplicationThreadDestroyed(ApplicationThread* thread);
33 33
34 private: 34 private:
35 // Overridden from mojo::ApplicationDelegate: 35 // Overridden from mojo::ShellClient:
36 void Initialize(mojo::Shell* shell, const std::string& url, 36 void Initialize(mojo::Shell* shell, const std::string& url,
37 uint32_t id) override; 37 uint32_t id) override;
38 bool AcceptConnection( 38 bool AcceptConnection(mojo::Connection* connection) override;
39 mojo::ApplicationConnection* connection) override;
40 void Quit() override; 39 void Quit() override;
41 40
42 // Overridden from mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>: 41 // Overridden from mojo::InterfaceFactory<mojo::shell::mojom::ContentHandler>:
43 void Create( 42 void Create(
44 mojo::ApplicationConnection* connection, 43 mojo::Connection* connection,
45 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler> 44 mojo::InterfaceRequest<mojo::shell::mojom::ContentHandler>
46 request) override; 45 request) override;
47 46
48 // Overridden from mojo::shell::mojom::ContentHandler: 47 // Overridden from mojo::shell::mojom::ContentHandler:
49 void StartApplication( 48 void StartApplication(
50 mojo::InterfaceRequest<mojo::shell::mojom::Application> request, 49 mojo::InterfaceRequest<mojo::shell::mojom::Application> request,
51 mojo::URLResponsePtr response, 50 mojo::URLResponsePtr response,
52 const mojo::Callback<void()>& destruct_callback) override; 51 const mojo::Callback<void()>& destruct_callback) override;
53 52
54 // Bindings for all of our connections. 53 // Bindings for all of our connections.
55 mojo::WeakBindingSet<mojo::shell::mojom::ContentHandler> handler_bindings_; 54 mojo::WeakBindingSet<mojo::shell::mojom::ContentHandler> handler_bindings_;
56 55
57 ScopedVector<ApplicationThread> application_threads_; 56 ScopedVector<ApplicationThread> application_threads_;
58 mojo::TracingImpl tracing_; 57 mojo::TracingImpl tracing_;
59 58
60 base::WeakPtrFactory<CoreServicesApplicationDelegate> weak_factory_; 59 base::WeakPtrFactory<CoreServicesApplicationDelegate> weak_factory_;
61 60
62 DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate); 61 DISALLOW_COPY_AND_ASSIGN(CoreServicesApplicationDelegate);
63 }; 62 };
64 63
65 } // namespace core_services 64 } // namespace core_services
66 65
67 #endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H _ 66 #endif // MANDOLINE_SERVICES_CORE_SERVICES_CORE_SERVICES_APPLICATION_DELEGATE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698