OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 "ash/mus/keyboard_ui_mus.h" | 5 #include "ash/mus/keyboard_ui_mus.h" |
6 | 6 |
7 #include "ash/common/keyboard/keyboard_ui_observer.h" | 7 #include "ash/common/keyboard/keyboard_ui_observer.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "content/public/common/service_names.mojom.h" | 9 #include "content/public/common/service_names.mojom.h" |
10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 void KeyboardUIMus::Hide() { | 32 void KeyboardUIMus::Hide() { |
33 keyboard_->Hide(); | 33 keyboard_->Hide(); |
34 } | 34 } |
35 | 35 |
36 void KeyboardUIMus::Show() { | 36 void KeyboardUIMus::Show() { |
37 keyboard_->Show(); | 37 keyboard_->Show(); |
38 } | 38 } |
39 | 39 |
| 40 void KeyboardUIMus::ShowInDisplay(const int64_t display_id) { |
| 41 // TODO(yhanada): Send display id after adding a display_id argument to |
| 42 // |Keyboard::Show()| in keyboard.mojom. See crbug.com/585253. |
| 43 keyboard_->Show(); |
| 44 } |
| 45 |
40 bool KeyboardUIMus::IsEnabled() { | 46 bool KeyboardUIMus::IsEnabled() { |
41 return is_enabled_; | 47 return is_enabled_; |
42 } | 48 } |
43 | 49 |
44 void KeyboardUIMus::OnKeyboardStateChanged(bool is_enabled, | 50 void KeyboardUIMus::OnKeyboardStateChanged(bool is_enabled, |
45 bool is_visible, | 51 bool is_visible, |
46 uint64_t display_id, | 52 uint64_t display_id, |
47 const gfx::Rect& bounds) { | 53 const gfx::Rect& bounds) { |
48 if (is_enabled_ == is_enabled) | 54 if (is_enabled_ == is_enabled) |
49 return; | 55 return; |
50 | 56 |
51 is_enabled_ = is_enabled; | 57 is_enabled_ = is_enabled; |
52 for (auto& observer : *observers()) | 58 for (auto& observer : *observers()) |
53 observer.OnKeyboardEnabledStateChanged(is_enabled); | 59 observer.OnKeyboardEnabledStateChanged(is_enabled); |
54 } | 60 } |
55 | 61 |
56 } // namespace ash | 62 } // namespace ash |
OLD | NEW |