OLD | NEW |
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 #include "mash/shell/shell_application_delegate.h" | 5 #include "mash/shell/shell_application_delegate.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "mojo/shell/public/cpp/application_connection.h" | 8 #include "mojo/shell/public/cpp/application_connection.h" |
9 #include "mojo/shell/public/cpp/application_impl.h" | 9 #include "mojo/shell/public/cpp/application_impl.h" |
10 | 10 |
11 namespace mash { | 11 namespace mash { |
12 namespace shell { | 12 namespace shell { |
13 | 13 |
14 ShellApplicationDelegate::ShellApplicationDelegate() : app_(nullptr) {} | 14 ShellApplicationDelegate::ShellApplicationDelegate() : app_(nullptr) {} |
15 | 15 |
16 ShellApplicationDelegate::~ShellApplicationDelegate() {} | 16 ShellApplicationDelegate::~ShellApplicationDelegate() {} |
17 | 17 |
18 void ShellApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { | 18 void ShellApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { |
19 app_ = app; | 19 app_ = app; |
20 StartBrowserDriver(); | 20 StartBrowserDriver(); |
21 StartWindowManager(); | 21 StartWindowManager(); |
22 StartWallpaper(); | 22 StartWallpaper(); |
23 StartSystemUI(); | 23 StartShelf(); |
24 StartQuickLaunch(); | 24 StartQuickLaunch(); |
25 } | 25 } |
26 | 26 |
27 bool ShellApplicationDelegate::ConfigureIncomingConnection( | 27 bool ShellApplicationDelegate::ConfigureIncomingConnection( |
28 mojo::ApplicationConnection* connection) { | 28 mojo::ApplicationConnection* connection) { |
29 return false; | 29 return false; |
30 } | 30 } |
31 | 31 |
32 void ShellApplicationDelegate::StartWindowManager() { | 32 void ShellApplicationDelegate::StartWindowManager() { |
33 StartRestartableService( | 33 StartRestartableService( |
34 "mojo:desktop_wm", | 34 "mojo:desktop_wm", |
35 base::Bind(&ShellApplicationDelegate::StartWindowManager, | 35 base::Bind(&ShellApplicationDelegate::StartWindowManager, |
36 base::Unretained(this))); | 36 base::Unretained(this))); |
37 } | 37 } |
38 | 38 |
39 void ShellApplicationDelegate::StartWallpaper() { | 39 void ShellApplicationDelegate::StartWallpaper() { |
40 StartRestartableService("mojo:wallpaper", | 40 StartRestartableService("mojo:wallpaper", |
41 base::Bind(&ShellApplicationDelegate::StartWallpaper, | 41 base::Bind(&ShellApplicationDelegate::StartWallpaper, |
42 base::Unretained(this))); | 42 base::Unretained(this))); |
43 } | 43 } |
44 | 44 |
45 void ShellApplicationDelegate::StartSystemUI() { | 45 void ShellApplicationDelegate::StartShelf() { |
46 StartRestartableService("mojo:system_ui", | 46 StartRestartableService("mojo:shelf", |
47 base::Bind(&ShellApplicationDelegate::StartSystemUI, | 47 base::Bind(&ShellApplicationDelegate::StartShelf, |
48 base::Unretained(this))); | 48 base::Unretained(this))); |
49 } | 49 } |
50 | 50 |
51 void ShellApplicationDelegate::StartBrowserDriver() { | 51 void ShellApplicationDelegate::StartBrowserDriver() { |
52 StartRestartableService( | 52 StartRestartableService( |
53 "mojo:browser_driver", | 53 "mojo:browser_driver", |
54 base::Bind(&ShellApplicationDelegate::StartBrowserDriver, | 54 base::Bind(&ShellApplicationDelegate::StartBrowserDriver, |
55 base::Unretained(this))); | 55 base::Unretained(this))); |
56 } | 56 } |
57 | 57 |
(...skipping 10 matching lines...) Expand all Loading... |
68 // TODO(beng): This would be the place to insert logic that counted restarts | 68 // TODO(beng): This would be the place to insert logic that counted restarts |
69 // to avoid infinite crash-restart loops. | 69 // to avoid infinite crash-restart loops. |
70 scoped_ptr<mojo::ApplicationConnection> connection = | 70 scoped_ptr<mojo::ApplicationConnection> connection = |
71 app_->ConnectToApplication(url); | 71 app_->ConnectToApplication(url); |
72 connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback); | 72 connection->SetRemoteServiceProviderConnectionErrorHandler(restart_callback); |
73 connections_[url] = std::move(connection); | 73 connections_[url] = std::move(connection); |
74 } | 74 } |
75 | 75 |
76 } // namespace shell | 76 } // namespace shell |
77 } // namespace main | 77 } // namespace main |
OLD | NEW |