| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void KeyboardController::ShowKeyboard(bool lock) { | 299 void KeyboardController::ShowKeyboard(bool lock) { |
| 300 set_keyboard_locked(lock); | 300 set_keyboard_locked(lock); |
| 301 ShowKeyboardInternal(display::kInvalidDisplayId); | 301 ShowKeyboardInternal(display::kInvalidDisplayId); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void KeyboardController::ShowKeyboardInDisplay(int64_t display_id) { | 304 void KeyboardController::ShowKeyboardInDisplay(int64_t display_id) { |
| 305 set_keyboard_locked(true); | 305 set_keyboard_locked(true); |
| 306 ShowKeyboardInternal(display_id); | 306 ShowKeyboardInternal(display_id); |
| 307 } | 307 } |
| 308 | 308 |
| 309 bool KeyboardController::IsKeyboardWindowCreated() { |
| 310 return keyboard_container_initialized() && ui_->HasKeyboardWindow(); |
| 311 } |
| 312 |
| 309 void KeyboardController::OnWindowHierarchyChanged( | 313 void KeyboardController::OnWindowHierarchyChanged( |
| 310 const HierarchyChangeParams& params) { | 314 const HierarchyChangeParams& params) { |
| 311 if (params.new_parent && params.target == container_.get()) | 315 if (params.new_parent && params.target == container_.get()) |
| 312 OnTextInputStateChanged(ui_->GetInputMethod()->GetTextInputClient()); | 316 OnTextInputStateChanged(ui_->GetInputMethod()->GetTextInputClient()); |
| 313 } | 317 } |
| 314 | 318 |
| 315 void KeyboardController::OnWindowAddedToRootWindow(aura::Window* window) { | 319 void KeyboardController::OnWindowAddedToRootWindow(aura::Window* window) { |
| 316 if (!window->GetRootWindow()->HasObserver(this)) | 320 if (!window->GetRootWindow()->HasObserver(this)) |
| 317 window->GetRootWindow()->AddObserver(this); | 321 window->GetRootWindow()->AddObserver(this); |
| 318 } | 322 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 ui_->EnsureCaretInWorkArea(); | 505 ui_->EnsureCaretInWorkArea(); |
| 502 } | 506 } |
| 503 | 507 |
| 504 void KeyboardController::HideAnimationFinished() { | 508 void KeyboardController::HideAnimationFinished() { |
| 505 ui_->HideKeyboardContainer(container_.get()); | 509 ui_->HideKeyboardContainer(container_.get()); |
| 506 for (KeyboardControllerObserver& observer : observer_list_) | 510 for (KeyboardControllerObserver& observer : observer_list_) |
| 507 observer.OnKeyboardHidden(); | 511 observer.OnKeyboardHidden(); |
| 508 } | 512 } |
| 509 | 513 |
| 510 } // namespace keyboard | 514 } // namespace keyboard |
| OLD | NEW |