| 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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 DISALLOW_COPY_AND_ASSIGN(EmbeddedAshService); | 47 DISALLOW_COPY_AND_ASSIGN(EmbeddedAshService); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 std::unique_ptr<service_manager::Service> CreateEmbeddedAshService( | 52 std::unique_ptr<service_manager::Service> CreateEmbeddedAshService( |
| 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { | 53 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { |
| 54 return base::MakeUnique<EmbeddedAshService>(task_runner); | 54 return base::MakeUnique<EmbeddedAshService>(task_runner); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace ash_util | |
| 58 | |
| 59 namespace chrome { | |
| 60 | |
| 61 bool ShouldOpenAshOnStartup() { | 57 bool ShouldOpenAshOnStartup() { |
| 62 return !IsRunningInMash(); | 58 return !IsRunningInMash(); |
| 63 } | 59 } |
| 64 | 60 |
| 65 bool IsRunningInMash() { | 61 bool IsRunningInMash() { |
| 66 return service_manager::ServiceManagerIsRemote(); | 62 return service_manager::ServiceManagerIsRemote(); |
| 67 } | 63 } |
| 68 | 64 |
| 69 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { | 65 bool IsAcceleratorDeprecated(const ui::Accelerator& accelerator) { |
| 70 // When running in mash the browser doesn't handle ash accelerators. | 66 // When running in mash the browser doesn't handle ash accelerators. |
| 71 if (chrome::IsRunningInMash()) | 67 if (IsRunningInMash()) |
| 72 return false; | 68 return false; |
| 73 | 69 |
| 74 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated( | 70 return ash::WmShell::Get()->accelerator_controller()->IsDeprecated( |
| 75 accelerator); | 71 accelerator); |
| 76 } | 72 } |
| 77 | 73 |
| 78 } // namespace chrome | 74 } // namespace ash_util |
| OLD | NEW |