| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 enum class Accelerator : uint32_t { | 23 enum class Accelerator : uint32_t { |
| 24 NewChromeWindow, | 24 NewChromeWindow, |
| 25 NewChromeTab, | 25 NewChromeTab, |
| 26 NewChromeIncognitoWindow, | 26 NewChromeIncognitoWindow, |
| 27 ShowTaskManager, | 27 ShowTaskManager, |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 struct AcceleratorSpec { | 30 struct AcceleratorSpec { |
| 31 Accelerator id; | 31 Accelerator id; |
| 32 mus::mojom::KeyboardCode keyboard_code; | 32 ui::mojom::KeyboardCode keyboard_code; |
| 33 // A bitfield of kEventFlag* and kMouseEventFlag* values in | 33 // A bitfield of kEventFlag* and kMouseEventFlag* values in |
| 34 // input_event_constants.mojom. | 34 // input_event_constants.mojom. |
| 35 int event_flags; | 35 int event_flags; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 AcceleratorSpec g_spec[] = { | 38 AcceleratorSpec g_spec[] = { |
| 39 {Accelerator::NewChromeWindow, mus::mojom::KeyboardCode::N, | 39 {Accelerator::NewChromeWindow, ui::mojom::KeyboardCode::N, |
| 40 mus::mojom::kEventFlagControlDown}, | 40 ui::mojom::kEventFlagControlDown}, |
| 41 {Accelerator::NewChromeTab, mus::mojom::KeyboardCode::T, | 41 {Accelerator::NewChromeTab, ui::mojom::KeyboardCode::T, |
| 42 mus::mojom::kEventFlagControlDown}, | 42 ui::mojom::kEventFlagControlDown}, |
| 43 {Accelerator::NewChromeIncognitoWindow, mus::mojom::KeyboardCode::N, | 43 {Accelerator::NewChromeIncognitoWindow, ui::mojom::KeyboardCode::N, |
| 44 mus::mojom::kEventFlagControlDown | mus::mojom::kEventFlagShiftDown}, | 44 ui::mojom::kEventFlagControlDown | ui::mojom::kEventFlagShiftDown}, |
| 45 {Accelerator::ShowTaskManager, mus::mojom::KeyboardCode::ESCAPE, | 45 {Accelerator::ShowTaskManager, ui::mojom::KeyboardCode::ESCAPE, |
| 46 mus::mojom::kEventFlagShiftDown}, | 46 ui::mojom::kEventFlagShiftDown}, |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 void AssertTrue(bool success) { | 49 void AssertTrue(bool success) { |
| 50 DCHECK(success); | 50 DCHECK(success); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void DoNothing() {} | 53 void DoNothing() {} |
| 54 | 54 |
| 55 } // namespace | 55 } // namespace |
| 56 | 56 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 void AppDriver::AddAccelerators() { | 131 void AppDriver::AddAccelerators() { |
| 132 connector_->ConnectToInterface("mojo:catalog", &catalog_); | 132 connector_->ConnectToInterface("mojo:catalog", &catalog_); |
| 133 catalog_->GetEntriesProvidingClass( | 133 catalog_->GetEntriesProvidingClass( |
| 134 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, | 134 "mus:window_manager", base::Bind(&AppDriver::OnAvailableCatalogEntries, |
| 135 weak_factory_.GetWeakPtr())); | 135 weak_factory_.GetWeakPtr())); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace app_driver | 138 } // namespace app_driver |
| 139 } // namespace mash | 139 } // namespace mash |
| OLD | NEW |