OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/ash/ash_util.h" | 5 #include "chrome/browser/ui/ash/ash_util.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/mojo_interface_factory.h" | 8 #include "ash/mojo_interface_factory.h" |
9 #include "ash/public/cpp/config.h" | 9 #include "ash/public/cpp/config.h" |
10 #include "ash/public/interfaces/event_properties.mojom.h" | 10 #include "ash/public/interfaces/event_properties.mojom.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/browser/chromeos/ash_config.h" | 15 #include "chrome/browser/chromeos/ash_config.h" |
16 #include "chrome/browser/ui/ash/ash_init.h" | 16 #include "chrome/browser/ui/ash/ash_init.h" |
17 #include "content/public/common/service_names.mojom.h" | 17 #include "content/public/common/service_names.mojom.h" |
| 18 #include "services/service_manager/public/cpp/bind_source_info.h" |
18 #include "services/service_manager/public/cpp/binder_registry.h" | 19 #include "services/service_manager/public/cpp/binder_registry.h" |
19 #include "services/service_manager/public/cpp/service.h" | 20 #include "services/service_manager/public/cpp/service.h" |
20 #include "services/service_manager/public/cpp/service_info.h" | |
21 #include "services/service_manager/public/interfaces/interface_provider_spec.moj
om.h" | 21 #include "services/service_manager/public/interfaces/interface_provider_spec.moj
om.h" |
22 #include "ui/aura/window_event_dispatcher.h" | 22 #include "ui/aura/window_event_dispatcher.h" |
23 | 23 |
24 namespace ash_util { | 24 namespace ash_util { |
25 | 25 |
26 namespace { | 26 namespace { |
27 | 27 |
28 class EmbeddedAshService : public service_manager::Service { | 28 class EmbeddedAshService : public service_manager::Service { |
29 public: | 29 public: |
30 explicit EmbeddedAshService( | 30 explicit EmbeddedAshService( |
31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
32 : task_runner_(task_runner) {} | 32 : task_runner_(task_runner) {} |
33 ~EmbeddedAshService() override {} | 33 ~EmbeddedAshService() override {} |
34 | 34 |
35 // service_manager::Service: | 35 // service_manager::Service: |
36 void OnStart() override { | 36 void OnStart() override { |
37 ash::mojo_interface_factory::RegisterInterfaces(&interfaces_, task_runner_); | 37 ash::mojo_interface_factory::RegisterInterfaces(&interfaces_, task_runner_); |
38 } | 38 } |
39 | 39 |
40 void OnBindInterface(const service_manager::ServiceInfo& remote_info, | 40 void OnBindInterface(const service_manager::BindSourceInfo& remote_info, |
41 const std::string& interface_name, | 41 const std::string& interface_name, |
42 mojo::ScopedMessagePipeHandle handle) override { | 42 mojo::ScopedMessagePipeHandle handle) override { |
43 interfaces_.BindInterface(remote_info.identity, interface_name, | 43 interfaces_.BindInterface(remote_info.identity, interface_name, |
44 std::move(handle)); | 44 std::move(handle)); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
48 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 48 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
49 service_manager::BinderRegistry interfaces_; | 49 service_manager::BinderRegistry interfaces_; |
50 | 50 |
(...skipping 23 matching lines...) Expand all Loading... |
74 return ash::Shell::Get()->accelerator_controller()->IsDeprecated(accelerator); | 74 return ash::Shell::Get()->accelerator_controller()->IsDeprecated(accelerator); |
75 } | 75 } |
76 | 76 |
77 bool WillAshProcessAcceleratorForEvent(const ui::KeyEvent& key_event) { | 77 bool WillAshProcessAcceleratorForEvent(const ui::KeyEvent& key_event) { |
78 return key_event.properties() && | 78 return key_event.properties() && |
79 key_event.properties()->count( | 79 key_event.properties()->count( |
80 ash::mojom::kWillProcessAccelerator_KeyEventProperty); | 80 ash::mojom::kWillProcessAccelerator_KeyEventProperty); |
81 } | 81 } |
82 | 82 |
83 } // namespace ash_util | 83 } // namespace ash_util |
OLD | NEW |