| 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/keyboard/keyboard_ui_observer.h" | 7 #include "ash/keyboard/keyboard_ui_observer.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "mojo/shell/public/cpp/connector.h" | 10 #include "mojo/shell/public/cpp/connector.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 KeyboardUIMus::KeyboardUIMus(mojo::Connector* connector) | 14 KeyboardUIMus::KeyboardUIMus(mojo::Connector* connector) |
| 15 : is_enabled_(false), observer_binding_(this) { | 15 : is_enabled_(false), observer_binding_(this) { |
| 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("exe://chrome", &keyboard_); | 17 connector->ConnectToInterface("exe:chrome", &keyboard_); |
| 18 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind()); | 18 keyboard_->AddObserver(observer_binding_.CreateInterfacePtrAndBind()); |
| 19 } | 19 } |
| 20 | 20 |
| 21 KeyboardUIMus::~KeyboardUIMus() {} | 21 KeyboardUIMus::~KeyboardUIMus() {} |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 scoped_ptr<KeyboardUI> KeyboardUIMus::Create(mojo::Connector* connector) { | 24 scoped_ptr<KeyboardUI> KeyboardUIMus::Create(mojo::Connector* connector) { |
| 25 return make_scoped_ptr(new KeyboardUIMus(connector)); | 25 return make_scoped_ptr(new KeyboardUIMus(connector)); |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 43 mojo::RectPtr bounds) { | 43 mojo::RectPtr bounds) { |
| 44 if (is_enabled_ == is_enabled) | 44 if (is_enabled_ == is_enabled) |
| 45 return; | 45 return; |
| 46 | 46 |
| 47 is_enabled_ = is_enabled; | 47 is_enabled_ = is_enabled; |
| 48 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), | 48 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), |
| 49 OnKeyboardEnabledStateChanged(is_enabled)); | 49 OnKeyboardEnabledStateChanged(is_enabled)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace ash | 52 } // namespace ash |
| OLD | NEW |