OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/events/test/keyboard_layout.h" | |
6 | |
7 #if defined(OS_WIN) || defined(OS_MACOSX) | |
8 #include "base/logging.h" | |
9 | |
10 namespace ui { | |
11 | |
12 ScopedKeyboardLayout::ScopedKeyboardLayout(KeyboardLayout layout) { | |
13 original_layout_ = GetActiveLayout(); | |
14 CHECK(ActivateLayout(GetPlatformKeyboardLayout(layout))); | |
Peter Kasting
2016/08/18 17:48:19
Nit: We normally use CHECK only for security-sensi
Tomasz Moniuszko
2016/08/26 08:53:12
Done.
| |
15 } | |
16 | |
17 ScopedKeyboardLayout::~ScopedKeyboardLayout() { | |
18 ActivateLayout(original_layout_); | |
19 } | |
20 | |
21 } // namespace ui | |
22 | |
23 #endif // defined(OS_WIN) || defined(OS_MACOSX) | |
OLD | NEW |