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

Side by Side Diff: mash/browser/browser.h

Issue 2487573002: Service Manager: Remove ServiceContext* arg from Service::OnStart() (Closed)
Patch Set: rebase Created 4 years, 1 month 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 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 MASH_BROWSER_BROWSER_H_ 5 #ifndef MASH_BROWSER_BROWSER_H_
6 #define MASH_BROWSER_BROWSER_H_ 6 #define MASH_BROWSER_BROWSER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "mash/public/interfaces/launchable.mojom.h" 11 #include "mash/public/interfaces/launchable.mojom.h"
12 #include "mojo/public/cpp/bindings/binding_set.h" 12 #include "mojo/public/cpp/bindings/binding_set.h"
13 #include "services/service_manager/public/cpp/interface_factory.h" 13 #include "services/service_manager/public/cpp/interface_factory.h"
14 #include "services/service_manager/public/cpp/service.h" 14 #include "services/service_manager/public/cpp/service.h"
15 #include "services/tracing/public/cpp/provider.h" 15 #include "services/tracing/public/cpp/provider.h"
16 16
17 namespace navigation { 17 namespace navigation {
18 class View; 18 class View;
19 } 19 }
20 20
21 namespace service_manager {
22 class ServiceContext;
23 }
24
25 namespace views { 21 namespace views {
26 class AuraInit; 22 class AuraInit;
27 class Widget; 23 class Widget;
28 class WindowManagerConnection; 24 class WindowManagerConnection;
29 } 25 }
30 26
31 namespace mash { 27 namespace mash {
32 namespace browser { 28 namespace browser {
33 29
34 class Browser : public service_manager::Service, 30 class Browser : public service_manager::Service,
35 public mojom::Launchable, 31 public mojom::Launchable,
36 public service_manager::InterfaceFactory<mojom::Launchable> { 32 public service_manager::InterfaceFactory<mojom::Launchable> {
37 public: 33 public:
38 Browser(); 34 Browser();
39 ~Browser() override; 35 ~Browser() override;
40 36
41 // Start/stop tracking individual browser windows. When we no longer track any 37 // Start/stop tracking individual browser windows. When we no longer track any
42 // browser windows, the application terminates. The Browser object does not 38 // browser windows, the application terminates. The Browser object does not
43 // own these widgets. 39 // own these widgets.
44 void AddWindow(views::Widget* window); 40 void AddWindow(views::Widget* window);
45 void RemoveWindow(views::Widget* window); 41 void RemoveWindow(views::Widget* window);
46 42
47 std::unique_ptr<navigation::View> CreateView(); 43 std::unique_ptr<navigation::View> CreateView();
48 44
49 private: 45 private:
50 // service_manager::Service: 46 // service_manager::Service:
51 void OnStart(service_manager::ServiceContext* context) override; 47 void OnStart() override;
52 bool OnConnect(const service_manager::ServiceInfo& remote_info, 48 bool OnConnect(const service_manager::ServiceInfo& remote_info,
53 service_manager::InterfaceRegistry* registry) override; 49 service_manager::InterfaceRegistry* registry) override;
54 50
55 // mojom::Launchable: 51 // mojom::Launchable:
56 void Launch(uint32_t what, mojom::LaunchMode how) override; 52 void Launch(uint32_t what, mojom::LaunchMode how) override;
57 53
58 // service_manager::InterfaceFactory<mojom::Launchable>: 54 // service_manager::InterfaceFactory<mojom::Launchable>:
59 void Create(const service_manager::Identity& remote_identity, 55 void Create(const service_manager::Identity& remote_identity,
60 mojom::LaunchableRequest request) override; 56 mojom::LaunchableRequest request) override;
61 57
62 service_manager::ServiceContext* context_ = nullptr;
63
64 mojo::BindingSet<mojom::Launchable> bindings_; 58 mojo::BindingSet<mojom::Launchable> bindings_;
65 std::vector<views::Widget*> windows_; 59 std::vector<views::Widget*> windows_;
66 60
67 tracing::Provider tracing_; 61 tracing::Provider tracing_;
68 std::unique_ptr<views::AuraInit> aura_init_; 62 std::unique_ptr<views::AuraInit> aura_init_;
69 std::unique_ptr<views::WindowManagerConnection> window_manager_connection_; 63 std::unique_ptr<views::WindowManagerConnection> window_manager_connection_;
70 64
71 DISALLOW_COPY_AND_ASSIGN(Browser); 65 DISALLOW_COPY_AND_ASSIGN(Browser);
72 }; 66 };
73 67
74 } // namespace browser 68 } // namespace browser
75 } // namespace mash 69 } // namespace mash
76 70
77 #endif // MASH_BROWSER_BROWSER_H_ 71 #endif // MASH_BROWSER_BROWSER_H_
OLDNEW
« no previous file with comments | « content/common/service_manager/service_manager_connection_impl.cc ('k') | mash/browser/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698