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, observer_list_, |
| 18 OnInputMethodDestroyed(this)); |
17 } | 19 } |
18 | 20 |
19 void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { | 21 void MockInputMethod::SetDelegate(internal::InputMethodDelegate* delegate) { |
20 } | 22 } |
21 | 23 |
22 void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { | 24 void MockInputMethod::SetFocusedTextInputClient(TextInputClient* client) { |
23 if (switches::IsTextInputFocusManagerEnabled()) | 25 if (switches::IsTextInputFocusManagerEnabled()) |
24 return; | 26 return; |
25 | 27 |
26 if (text_input_client_ == client) | 28 if (text_input_client_ == client) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 119 |
118 void MockInputMethod::AddObserver(InputMethodObserver* observer) { | 120 void MockInputMethod::AddObserver(InputMethodObserver* observer) { |
119 observer_list_.AddObserver(observer); | 121 observer_list_.AddObserver(observer); |
120 } | 122 } |
121 | 123 |
122 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { | 124 void MockInputMethod::RemoveObserver(InputMethodObserver* observer) { |
123 observer_list_.RemoveObserver(observer); | 125 observer_list_.RemoveObserver(observer); |
124 } | 126 } |
125 | 127 |
126 } // namespace ui | 128 } // namespace ui |
OLD | NEW |