OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/ime_event_guard.h" | 5 #include "content/renderer/ime_event_guard.h" |
6 | 6 |
7 #include "content/renderer/render_widget.h" | 7 #include "content/renderer/render_widget.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
| 11 // When ThreadedInputConnection is used, we want to make sure that FROM_IME |
| 12 // is set only for OnRequestTextInputStateUpdate() so that we can distinguish |
| 13 // it from other updates so that we can wait for it safely. So it is false by |
| 14 // default. |
11 ImeEventGuard::ImeEventGuard(RenderWidget* widget) | 15 ImeEventGuard::ImeEventGuard(RenderWidget* widget) |
12 : ImeEventGuard(widget, false, true) { | 16 : widget_(widget), show_ime_(false), |
13 } | 17 from_ime_(!widget->IsUsingImeThread()) { |
14 | |
15 ImeEventGuard::ImeEventGuard(RenderWidget* widget, bool show_ime, bool from_ime) | |
16 : widget_(widget), | |
17 show_ime_(show_ime), | |
18 from_ime_(from_ime) { | |
19 widget_->OnImeEventGuardStart(this); | 18 widget_->OnImeEventGuardStart(this); |
20 } | 19 } |
21 | 20 |
22 ImeEventGuard::~ImeEventGuard() { | 21 ImeEventGuard::~ImeEventGuard() { |
23 widget_->OnImeEventGuardFinish(this); | 22 widget_->OnImeEventGuardFinish(this); |
24 } | 23 } |
25 | 24 |
26 } // namespace content | 25 } // namespace content |
OLD | NEW |