Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Side by Side Diff: chromeos/ime/ime_keyboard_ozone.cc

Issue 683773002: Adds ozone support for ime keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromeos/ime/fake_ime_keyboard.h" 5 #include "chromeos/ime/ime_keyboard_ozone.h"
6 #include "chromeos/ime/ime_keyboard.h"
7 6
8 namespace chromeos { 7 namespace chromeos {
9 namespace input_method { 8 namespace input_method {
10 9
10
11 ImeKeyboardOzone::ImeKeyboardOzone()
12 : set_current_keyboard_layout_by_name_count_(0),
13 caps_lock_is_enabled_(false),
14 auto_repeat_is_enabled_(false) {
15 }
16
17
18 ImeKeyboardOzone::~ImeKeyboardOzone() {
19 }
20
21 bool ImeKeyboardOzone::SetCurrentKeyboardLayoutByName(
22 const std::string& layout_name) {
23 // Call SetKeyMapping here.
24 // TODO: parse out layout name and variation.
25 return ImeKeyboard::SetCurrentKeyboardLayoutByName(layout_name);
26 }
27
28 void ImeKeyboardOzone::ReapplyCurrentKeyboardLayout() {
29 SetCurrentKeyboardLayoutByName(last_layout_);
30 }
31
32 void ImeKeyboardOzone::SetCapsLockEnabled(bool enable_caps_lock) {
33 // Call SetModifierStates here.
34 ImeKeyboard::SetCapsLockEnabled(enable_caps_lock);
35 }
36
37 bool ImeKeyboardOzone::CapsLockIsEnabled() {
38 // Call getModifierStates here.
39 return false;
40 }
41
42 bool ImeKeyboardOzone::IsAltGrAvailable() {
43 for (size_t i = 0; i < arraysize(kAltGrLayoutIds); ++i) {
44 if (last_layout_ == kAltGrLayoutIds[i])
45 return true;
46 }
47 return false;
48 }
49
50 void ImeKeyboardOzone::ReapplyCurrentModifierLockStatus() {
51 // call SetModifierStates here.
52 }
53
54 void ImeKeyboardOzone::DisableNumLock() {
55 SetCapsLockEnabled(caps_lock_is_enabled_);
56 }
57
58 bool ImeKeyboardOzone::IsISOLevel5ShiftAvailable() {
59 for (size_t i = 0; i < arraysize(kISOLevel5ShiftLayoutIds); ++i) {
60 if (last_layout_ == kISOLevel5ShiftLayoutIds[i])
61 return true;
62 }
63 return false;
64 }
65
66
11 // static 67 // static
12 ImeKeyboard* ImeKeyboard::Create() { 68 ImeKeyboard* ImeKeyboard::Create() {
13 return new FakeImeKeyboard; 69 return new ImeKeyboardOzone();
14 } 70 }
15 71
16 } // namespace input_method 72 } // namespace input_method
17 } // namespace chromeos 73 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698