| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_delegate.h" | 10 #include "ui/aura/window_delegate.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 ShowKeyboardInternal(); | 280 ShowKeyboardInternal(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void KeyboardController::OnWindowHierarchyChanged( | 283 void KeyboardController::OnWindowHierarchyChanged( |
| 284 const HierarchyChangeParams& params) { | 284 const HierarchyChangeParams& params) { |
| 285 if (params.new_parent && params.target == container_.get()) | 285 if (params.new_parent && params.target == container_.get()) |
| 286 OnTextInputStateChanged(proxy_->GetInputMethod()->GetTextInputClient()); | 286 OnTextInputStateChanged(proxy_->GetInputMethod()->GetTextInputClient()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 void KeyboardController::Reload() { | 289 void KeyboardController::Reload() { |
| 290 // Makes sure the keyboard window is initialized. | 290 if (proxy_->HasKeyboardWindow()) |
| 291 proxy_->GetKeyboardWindow(); | 291 proxy_->ReloadKeyboardIfNeeded(); |
| 292 proxy_->ReloadKeyboardIfNeeded(); | |
| 293 } | 292 } |
| 294 | 293 |
| 295 void KeyboardController::OnTextInputStateChanged( | 294 void KeyboardController::OnTextInputStateChanged( |
| 296 const ui::TextInputClient* client) { | 295 const ui::TextInputClient* client) { |
| 297 if (!container_.get()) | 296 if (!container_.get()) |
| 298 return; | 297 return; |
| 299 | 298 |
| 300 if (IsKeyboardUsabilityExperimentEnabled()) { | 299 if (IsKeyboardUsabilityExperimentEnabled()) { |
| 301 ShowKeyboardInternal(); | 300 ShowKeyboardInternal(); |
| 302 return; | 301 return; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 // background during animation. | 418 // background during animation. |
| 420 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); | 419 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); |
| 421 proxy_->EnsureCaretInWorkArea(); | 420 proxy_->EnsureCaretInWorkArea(); |
| 422 } | 421 } |
| 423 | 422 |
| 424 void KeyboardController::HideAnimationFinished() { | 423 void KeyboardController::HideAnimationFinished() { |
| 425 proxy_->HideKeyboardContainer(container_.get()); | 424 proxy_->HideKeyboardContainer(container_.get()); |
| 426 } | 425 } |
| 427 | 426 |
| 428 } // namespace keyboard | 427 } // namespace keyboard |
| OLD | NEW |