Chromium Code Reviews| 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/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
| 8 #include "ash/common/mojo_interface_factory.h" | 8 #include "ash/common/mojo_interface_factory.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "chrome/browser/ui/ash/ash_init.h" | 12 #include "chrome/browser/ui/ash/ash_init.h" |
|
stevenjb
2017/03/01 17:42:32
This dependency appears to be unnecessary and it l
James Cook
2017/03/01 18:11:15
I am uncertain if IsRunningInMash() as written bel
sky
2017/03/01 20:50:15
tl;dr this check should be in the client code, not
| |
| 13 #include "content/public/common/service_names.mojom.h" | 13 #include "content/public/common/service_names.mojom.h" |
| 14 #include "services/service_manager/public/cpp/interface_registry.h" | 14 #include "services/service_manager/public/cpp/interface_registry.h" |
| 15 #include "services/service_manager/public/cpp/service.h" | 15 #include "services/service_manager/public/cpp/service.h" |
| 16 #include "services/service_manager/public/interfaces/interface_provider_spec.moj om.h" | 16 #include "services/service_manager/public/interfaces/interface_provider_spec.moj om.h" |
| 17 #include "services/service_manager/runner/common/client_util.h" | 17 #include "services/service_manager/runner/common/client_util.h" |
| 18 #include "ui/aura/window_event_dispatcher.h" | 18 #include "ui/aura/window_event_dispatcher.h" |
| 19 | 19 |
| 20 namespace ash_util { | |
| 21 | |
| 22 namespace { | 20 namespace { |
| 23 | 21 |
| 24 class EmbeddedAshService : public service_manager::Service { | 22 class EmbeddedAshService : public service_manager::Service { |
| 25 public: | 23 public: |
| 26 explicit EmbeddedAshService( | 24 explicit EmbeddedAshService( |
| 27 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) | 25 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) |
| 28 : task_runner_(task_runner), | 26 : task_runner_(task_runner), |
| 29 interfaces_(service_manager::mojom::kServiceManager_ConnectorSpec) {} | 27 interfaces_(service_manager::mojom::kServiceManager_ConnectorSpec) {} |
| 30 ~EmbeddedAshService() override {} | 28 ~EmbeddedAshService() override {} |
| 31 | 29 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 } | 61 } |
| 64 | 62 |
| 65 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { | 63 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { |
| 66 // When running in mash the browser doesn't handle ash accelerators. | 64 // When running in mash the browser doesn't handle ash accelerators. |
| 67 if (IsRunningInMash()) | 65 if (IsRunningInMash()) |
| 68 return false; | 66 return false; |
| 69 | 67 |
| 70 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated( | 68 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated( |
| 71 accelerator); | 69 accelerator); |
| 72 } | 70 } |
| 73 | |
| 74 } // namespace ash_util | |
| OLD | NEW |