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 "services/shell/public/cpp/connector.h" | 9 #include "services/service_manager/public/cpp/connector.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 | 12 |
13 KeyboardUIMus::KeyboardUIMus(::shell::Connector* connector) | 13 KeyboardUIMus::KeyboardUIMus(::shell::Connector* connector) |
14 : is_enabled_(false), observer_binding_(this) { | 14 : is_enabled_(false), observer_binding_(this) { |
15 if (connector) { | 15 if (connector) { |
16 // TODO(sky): should be something like mojo:keyboard, but need mapping. | 16 // TODO(sky): should be something like mojo:keyboard, but need mapping. |
17 connector->ConnectToInterface("service:content_browser", &keyboard_); | 17 connector->ConnectToInterface("service:content_browser", &keyboard_); |
18 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind()); | 18 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind()); |
19 } | 19 } |
(...skipping 25 matching lines...) Expand all Loading... |
45 const gfx::Rect& bounds) { | 45 const gfx::Rect& bounds) { |
46 if (is_enabled_ == is_enabled) | 46 if (is_enabled_ == is_enabled) |
47 return; | 47 return; |
48 | 48 |
49 is_enabled_ = is_enabled; | 49 is_enabled_ = is_enabled; |
50 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), | 50 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), |
51 OnKeyboardEnabledStateChanged(is_enabled)); | 51 OnKeyboardEnabledStateChanged(is_enabled)); |
52 } | 52 } |
53 | 53 |
54 } // namespace ash | 54 } // namespace ash |
OLD | NEW |