| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/base/ime/input_method_base.h" | 5 #include "ui/base/ime/input_method_base.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/base/ime/input_method_delegate.h" | 8 #include "ui/base/ime/input_method_delegate.h" |
| 9 #include "ui/base/ime/input_method_observer.h" | 9 #include "ui/base/ime/input_method_observer.h" |
| 10 #include "ui/base/ime/text_input_client.h" | 10 #include "ui/base/ime/text_input_client.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 InputMethodBase::InputMethodBase() | 14 InputMethodBase::InputMethodBase() |
| 15 : delegate_(NULL), | 15 : delegate_(NULL), |
| 16 text_input_client_(NULL), | 16 text_input_client_(NULL), |
| 17 system_toplevel_window_focused_(false) { | 17 system_toplevel_window_focused_(false) { |
| 18 } | 18 } |
| 19 | 19 |
| 20 InputMethodBase::~InputMethodBase() { | 20 InputMethodBase::~InputMethodBase() { |
| 21 FOR_EACH_OBSERVER(InputMethodObserver, |
| 22 observer_list_, |
| 23 OnInputMethodDestroyed(this)); |
| 21 } | 24 } |
| 22 | 25 |
| 23 void InputMethodBase::SetDelegate(internal::InputMethodDelegate* delegate) { | 26 void InputMethodBase::SetDelegate(internal::InputMethodDelegate* delegate) { |
| 24 delegate_ = delegate; | 27 delegate_ = delegate; |
| 25 } | 28 } |
| 26 | 29 |
| 27 void InputMethodBase::Init(bool focused) { | 30 void InputMethodBase::Init(bool focused) { |
| 28 if (focused) | 31 if (focused) |
| 29 OnFocus(); | 32 OnFocus(); |
| 30 } | 33 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 107 } |
| 105 | 108 |
| 106 void InputMethodBase::NotifyTextInputStateChanged( | 109 void InputMethodBase::NotifyTextInputStateChanged( |
| 107 const TextInputClient* client) { | 110 const TextInputClient* client) { |
| 108 FOR_EACH_OBSERVER(InputMethodObserver, | 111 FOR_EACH_OBSERVER(InputMethodObserver, |
| 109 observer_list_, | 112 observer_list_, |
| 110 OnTextInputStateChanged(client)); | 113 OnTextInputStateChanged(client)); |
| 111 } | 114 } |
| 112 | 115 |
| 113 } // namespace ui | 116 } // namespace ui |
| OLD | NEW |