Chromium Code Reviews| Index: ui/events/test/keyboard_layout.cc |
| diff --git a/ui/events/test/keyboard_layout.cc b/ui/events/test/keyboard_layout.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..453d94069376339d1926a30246fa1b73aabda2ff |
| --- /dev/null |
| +++ b/ui/events/test/keyboard_layout.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/events/test/keyboard_layout.h" |
| + |
| +#include "base/logging.h" |
| + |
| +namespace ui { |
| + |
| +ScopedKeyboardLayout::ScopedKeyboardLayout(KeyboardLayout layout) { |
| + original_layout_ = GetActiveLayout(); |
| + ActivateLayout(GetPlatformKeyboardLayout(layout)); |
| +} |
| + |
| +ScopedKeyboardLayout::~ScopedKeyboardLayout() { |
| + ActivateLayout(original_layout_); |
| +} |
| + |
| +#if !defined(OS_WIN) && (!defined(OS_MACOSX) || defined(OS_IOS)) |
|
Wez
2016/09/16 00:57:18
nit: It may actually be clearer to write:
!(defin
Tomasz Moniuszko
2016/09/16 13:22:13
Done.
|
| +PlatformKeyboardLayout ScopedKeyboardLayout::GetActiveLayout() { |
| + NOTIMPLEMENTED(); |
| + return nullptr; |
| +} |
| + |
| +void ScopedKeyboardLayout::ActivateLayout(PlatformKeyboardLayout layout) { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +PlatformKeyboardLayout GetPlatformKeyboardLayout(KeyboardLayout layout) { |
| + NOTIMPLEMENTED(); |
| + return nullptr; |
| +} |
| +#endif |
| + |
| +} // namespace ui |