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/app_driver/app_driver.h" | 5 #include "mash/app_driver/app_driver.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "components/mus/common/event_matcher_util.h" | 11 #include "components/mus/common/event_matcher_util.h" |
| 12 #include "components/mus/common/gpu_service.h" |
12 #include "mash/public/interfaces/launchable.mojom.h" | 13 #include "mash/public/interfaces/launchable.mojom.h" |
13 #include "services/shell/public/cpp/connection.h" | 14 #include "services/shell/public/cpp/connection.h" |
14 #include "services/shell/public/cpp/connector.h" | 15 #include "services/shell/public/cpp/connector.h" |
15 | 16 |
16 using mash::mojom::LaunchablePtr; | 17 using mash::mojom::LaunchablePtr; |
17 using mash::mojom::LaunchMode; | 18 using mash::mojom::LaunchMode; |
18 | 19 |
19 namespace mash { | 20 namespace mash { |
20 namespace app_driver { | 21 namespace app_driver { |
21 namespace { | 22 namespace { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 static_cast<uint32_t>(spec.id), | 83 static_cast<uint32_t>(spec.id), |
83 mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags), | 84 mus::CreateKeyMatcher(spec.keyboard_code, spec.event_flags), |
84 base::Bind(&AssertTrue)); | 85 base::Bind(&AssertTrue)); |
85 } | 86 } |
86 } | 87 } |
87 | 88 |
88 void AppDriver::Initialize(shell::Connector* connector, | 89 void AppDriver::Initialize(shell::Connector* connector, |
89 const shell::Identity& identity, | 90 const shell::Identity& identity, |
90 uint32_t id) { | 91 uint32_t id) { |
91 connector_ = connector; | 92 connector_ = connector; |
| 93 mus::GpuService::Initialize(connector); |
92 AddAccelerators(); | 94 AddAccelerators(); |
93 } | 95 } |
94 | 96 |
95 bool AppDriver::AcceptConnection(shell::Connection* connection) { | 97 bool AppDriver::AcceptConnection(shell::Connection* connection) { |
96 return true; | 98 return true; |
97 } | 99 } |
98 | 100 |
99 bool AppDriver::ShellConnectionLost() { | 101 bool AppDriver::ShellConnectionLost() { |
100 // Prevent the code in AddAccelerators() from keeping this app alive. | 102 // Prevent the code in AddAccelerators() from keeping this app alive. |
101 binding_.set_connection_error_handler(base::Bind(&DoNothing)); | 103 binding_.set_connection_error_handler(base::Bind(&DoNothing)); |
(...skipping 28 matching lines...) Expand all Loading... |
130 | 132 |
131 void AppDriver::AddAccelerators() { | 133 void AppDriver::AddAccelerators() { |
132 connector_->ConnectToInterface("mojo:catalog", &catalog_); | 134 connector_->ConnectToInterface("mojo:catalog", &catalog_); |
133 catalog_->GetEntriesProvidingClass( | 135 catalog_->GetEntriesProvidingClass( |
134 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, | 136 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, |
135 weak_factory_.GetWeakPtr())); | 137 weak_factory_.GetWeakPtr())); |
136 } | 138 } |
137 | 139 |
138 } // namespace app_driver | 140 } // namespace app_driver |
139 } // namespace mash | 141 } // namespace mash |
OLD | NEW |