| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_NAVIGATION_NAVIGATION_H_ | 5 #ifndef SERVICES_NAVIGATION_NAVIGATION_H_ |
| 6 #define SERVICES_NAVIGATION_NAVIGATION_H_ | 6 #define SERVICES_NAVIGATION_NAVIGATION_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "base/sequenced_task_runner.h" | |
| 10 #include "content/public/common/connection_filter.h" | |
| 11 #include "mojo/public/cpp/bindings/binding_set.h" | 8 #include "mojo/public/cpp/bindings/binding_set.h" |
| 12 #include "services/navigation/public/interfaces/view.mojom.h" | 9 #include "services/navigation/public/interfaces/view.mojom.h" |
| 13 #include "services/shell/public/cpp/interface_factory.h" | 10 #include "services/shell/public/cpp/interface_factory.h" |
| 14 #include "services/shell/public/cpp/service.h" | 11 #include "services/shell/public/cpp/service.h" |
| 15 #include "services/shell/public/cpp/service_context_ref.h" | 12 #include "services/shell/public/cpp/service_context_ref.h" |
| 16 | 13 |
| 17 namespace content { | 14 namespace content { |
| 18 class BrowserContext; | 15 class BrowserContext; |
| 19 } | 16 } |
| 20 | 17 |
| 21 namespace navigation { | 18 namespace navigation { |
| 22 | 19 |
| 23 class Navigation : public content::ConnectionFilter, | 20 class Navigation : public shell::Service, |
| 24 public shell::InterfaceFactory<mojom::ViewFactory>, | 21 public shell::InterfaceFactory<mojom::ViewFactory>, |
| 25 public mojom::ViewFactory { | 22 public mojom::ViewFactory { |
| 26 public: | 23 public: |
| 27 Navigation(); | 24 Navigation(); |
| 28 ~Navigation() override; | 25 ~Navigation() override; |
| 29 | 26 |
| 30 private: | 27 private: |
| 31 // content::ConnectionFilter: | 28 // shell::Service: |
| 32 bool OnConnect(shell::Connection* connection, | 29 void OnStart(shell::Connector* connector, |
| 33 shell::Connector* connector) override; | 30 const shell::Identity& identity, |
| 31 uint32_t instance_id) override; |
| 32 bool OnConnect(shell::Connection* connection) override; |
| 34 | 33 |
| 35 // shell::InterfaceFactory<mojom::ViewFactory>: | 34 // shell::InterfaceFactory<mojom::ViewFactory>: |
| 36 void Create(shell::Connection* connection, | 35 void Create(shell::Connection* connection, |
| 37 mojom::ViewFactoryRequest request) override; | 36 mojom::ViewFactoryRequest request) override; |
| 38 | 37 |
| 39 // mojom::ViewFactory: | 38 // mojom::ViewFactory: |
| 40 void CreateView(mojom::ViewClientPtr client, | 39 void CreateView(mojom::ViewClientPtr client, |
| 41 mojom::ViewRequest request) override; | 40 mojom::ViewRequest request) override; |
| 42 | 41 |
| 43 void ViewFactoryLost(); | 42 void ViewFactoryLost(); |
| 44 | 43 |
| 45 scoped_refptr<base::SequencedTaskRunner> view_task_runner_; | |
| 46 | |
| 47 shell::Connector* connector_ = nullptr; | 44 shell::Connector* connector_ = nullptr; |
| 48 std::string client_user_id_; | 45 std::string client_user_id_; |
| 49 | 46 |
| 50 shell::ServiceContextRefFactory ref_factory_; | 47 shell::ServiceContextRefFactory ref_factory_; |
| 51 std::set<std::unique_ptr<shell::ServiceContextRef>> refs_; | 48 std::set<std::unique_ptr<shell::ServiceContextRef>> refs_; |
| 52 | 49 |
| 53 mojo::BindingSet<mojom::ViewFactory> bindings_; | 50 mojo::BindingSet<mojom::ViewFactory> bindings_; |
| 54 | 51 |
| 55 DISALLOW_COPY_AND_ASSIGN(Navigation); | 52 DISALLOW_COPY_AND_ASSIGN(Navigation); |
| 56 }; | 53 }; |
| 57 | 54 |
| 58 } // navigation | 55 } // navigation |
| 59 | 56 |
| 60 #endif // SERVICES_NAVIGATION_NAVIGATION_H_ | 57 #endif // SERVICES_NAVIGATION_NAVIGATION_H_ |
| OLD | NEW |