| 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 "chrome/browser/ui/input_method/input_method_engine_base.h" | 5 #include "chrome/browser/ui/input_method/input_method_engine_base.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #undef FocusIn | 9 #undef FocusIn |
| 10 #undef FocusOut | 10 #undef FocusOut |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 base::UTF16ToUTF8(composition_text_->text)); | 341 base::UTF16ToUTF8(composition_text_->text)); |
| 342 composition_text_.reset(new ui::CompositionText()); | 342 composition_text_.reset(new ui::CompositionText()); |
| 343 observer_->OnDeactivated(active_component_id_); | 343 observer_->OnDeactivated(active_component_id_); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void InputMethodEngineBase::Reset() { | 346 void InputMethodEngineBase::Reset() { |
| 347 composition_text_.reset(new ui::CompositionText()); | 347 composition_text_.reset(new ui::CompositionText()); |
| 348 observer_->OnReset(active_component_id_); | 348 observer_->OnReset(active_component_id_); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void InputMethodEngineBase::MaybeSwitchEngine() { |
| 352 observer_->OnRequestEngineSwitch(); |
| 353 } |
| 354 |
| 351 bool InputMethodEngineBase::IsInterestedInKeyEvent() const { | 355 bool InputMethodEngineBase::IsInterestedInKeyEvent() const { |
| 352 return observer_->IsInterestedInKeyEvent(); | 356 return observer_->IsInterestedInKeyEvent(); |
| 353 } | 357 } |
| 354 | 358 |
| 355 void InputMethodEngineBase::ProcessKeyEvent(const ui::KeyEvent& key_event, | 359 void InputMethodEngineBase::ProcessKeyEvent(const ui::KeyEvent& key_event, |
| 356 KeyEventDoneCallback& callback) { | 360 KeyEventDoneCallback& callback) { |
| 357 // Make true that we don't handle IME API calling of setComposition and | 361 // Make true that we don't handle IME API calling of setComposition and |
| 358 // commitText while the extension is handling key event. | 362 // commitText while the extension is handling key event. |
| 359 handling_key_event_ = true; | 363 handling_key_event_ = true; |
| 360 | 364 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 ui::EventTimeForNow()); | 459 ui::EventTimeForNow()); |
| 456 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_, | 460 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_, |
| 457 &ui_event); | 461 &ui_event); |
| 458 if (!SendKeyEvent(&ui_event, event.code)) | 462 if (!SendKeyEvent(&ui_event, event.code)) |
| 459 return false; | 463 return false; |
| 460 } | 464 } |
| 461 return true; | 465 return true; |
| 462 } | 466 } |
| 463 | 467 |
| 464 } // namespace input_method | 468 } // namespace input_method |
| OLD | NEW |