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/mock_input_method.h" | 5 #include "ui/base/ime/mock_input_method.h" |
6 | 6 |
7 #include "ui/base/ime/text_input_focus_manager.h" | 7 #include "ui/base/ime/text_input_focus_manager.h" |
8 #include "ui/base/ui_base_switches_util.h" | 8 #include "ui/base/ui_base_switches_util.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 | 11 |
12 MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate) | 12 MockInputMethod::MockInputMethod(internal::InputMethodDelegate* delegate) |
13 : text_input_client_(NULL) { | 13 : text_input_client_(NULL) { |
14 } | 14 } |
15 | 15 |
16 MockInputMethod::~MockInputMethod() { | 16 MockInputMethod::~MockInputMethod() { |
| 17 FOR_EACH_OBSERVER(InputMethodObserver, |
| 18 observer_list_, |
| 19 OnInputMethodDestroyed(this)); |
17 } | 20 } |
18 | 21 |
19 void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { | 22 void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { |
20 } | 23 } |
21 | 24 |
22 void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { | 25 void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { |
23 if (switches::IsTextInputFocusManagerEnabled()) | 26 if (switches::IsTextInputFocusManagerEnabled()) |
24 return; | 27 return; |
25 | 28 |
26 if (text_input_client_ == client) | 29 if (text_input_client_ == client) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 120 |
118 void MockInputMethod::AddObserver(InputMethodObserver* observer) { | 121 void MockInputMethod::AddObserver(InputMethodObserver* observer) { |
119 observer_list_.AddObserver(observer); | 122 observer_list_.AddObserver(observer); |
120 } | 123 } |
121 | 124 |
122 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { | 125 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { |
123 observer_list_.RemoveObserver(observer); | 126 observer_list_.RemoveObserver(observer); |
124 } | 127 } |
125 | 128 |
126 } // namespace ui | 129 } // namespace ui |
OLD | NEW |