| 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 "components/arc/ime/arc_ime_service.h" | 5 #include "components/arc/ime/arc_ime_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 aura::Env* env = aura::Env::GetInstanceDontCreate(); | 67 aura::Env* env = aura::Env::GetInstanceDontCreate(); |
| 68 if (env) | 68 if (env) |
| 69 env->AddObserver(this); | 69 env->AddObserver(this); |
| 70 } | 70 } |
| 71 | 71 |
| 72 ArcImeService::~ArcImeService() { | 72 ArcImeService::~ArcImeService() { |
| 73 ui::InputMethod* const input_method = GetInputMethod(); | 73 ui::InputMethod* const input_method = GetInputMethod(); |
| 74 if (input_method) | 74 if (input_method) |
| 75 input_method->DetachTextInputClient(this); | 75 input_method->DetachTextInputClient(this); |
| 76 | 76 |
| 77 if (focused_arc_window_) |
| 78 focused_arc_window_->RemoveObserver(this); |
| 77 if (is_focus_observer_installed_) | 79 if (is_focus_observer_installed_) |
| 78 arc_window_delegate_->UnregisterFocusObserver(); | 80 arc_window_delegate_->UnregisterFocusObserver(); |
| 79 aura::Env* env = aura::Env::GetInstanceDontCreate(); | 81 aura::Env* env = aura::Env::GetInstanceDontCreate(); |
| 80 if (env) | 82 if (env) |
| 81 env->RemoveObserver(this); | 83 env->RemoveObserver(this); |
| 82 // Removing |this| from KeyboardController. | 84 // Removing |this| from KeyboardController. |
| 83 keyboard::KeyboardController* keyboard_controller = | 85 keyboard::KeyboardController* keyboard_controller = |
| 84 keyboard::KeyboardController::GetInstance(); | 86 keyboard::KeyboardController::GetInstance(); |
| 85 if (keyboard_controller && keyboard_controller_ == keyboard_controller) { | 87 if (keyboard_controller && keyboard_controller_ == keyboard_controller) { |
| 86 keyboard_controller_->RemoveObserver(this); | 88 keyboard_controller_->RemoveObserver(this); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 base::i18n::TextDirection direction) { | 395 base::i18n::TextDirection direction) { |
| 394 return false; | 396 return false; |
| 395 } | 397 } |
| 396 | 398 |
| 397 bool ArcImeService::IsTextEditCommandEnabled( | 399 bool ArcImeService::IsTextEditCommandEnabled( |
| 398 ui::TextEditCommand command) const { | 400 ui::TextEditCommand command) const { |
| 399 return false; | 401 return false; |
| 400 } | 402 } |
| 401 | 403 |
| 402 } // namespace arc | 404 } // namespace arc |
| OLD | NEW |