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/layout_manager.h" | 9 #include "ui/aura/layout_manager.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 } | 307 } |
308 | 308 |
309 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) { | 309 void KeyboardController::AddObserver(KeyboardControllerObserver* observer) { |
310 observer_list_.AddObserver(observer); | 310 observer_list_.AddObserver(observer); |
311 } | 311 } |
312 | 312 |
313 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) { | 313 void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) { |
314 observer_list_.RemoveObserver(observer); | 314 observer_list_.RemoveObserver(observer); |
315 } | 315 } |
316 | 316 |
| 317 void KeyboardController::ShowAndLockKeyboard() { |
| 318 set_lock_keyboard(true); |
| 319 OnShowImeIfNeeded(); |
| 320 } |
| 321 |
317 void KeyboardController::OnWindowHierarchyChanged( | 322 void KeyboardController::OnWindowHierarchyChanged( |
318 const HierarchyChangeParams& params) { | 323 const HierarchyChangeParams& params) { |
319 if (params.new_parent && params.target == container_.get()) | 324 if (params.new_parent && params.target == container_.get()) |
320 OnTextInputStateChanged(proxy_->GetInputMethod()->GetTextInputClient()); | 325 OnTextInputStateChanged(proxy_->GetInputMethod()->GetTextInputClient()); |
321 } | 326 } |
322 | 327 |
323 void KeyboardController::SetOverrideContentUrl(const GURL& url) { | 328 void KeyboardController::SetOverrideContentUrl(const GURL& url) { |
324 proxy_->SetOverrideContentUrl(url); | 329 proxy_->SetOverrideContentUrl(url); |
325 } | 330 } |
326 | 331 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // background during animation. | 455 // background during animation. |
451 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); | 456 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); |
452 proxy_->EnsureCaretInWorkArea(); | 457 proxy_->EnsureCaretInWorkArea(); |
453 } | 458 } |
454 | 459 |
455 void KeyboardController::HideAnimationFinished() { | 460 void KeyboardController::HideAnimationFinished() { |
456 proxy_->HideKeyboardContainer(container_.get()); | 461 proxy_->HideKeyboardContainer(container_.get()); |
457 } | 462 } |
458 | 463 |
459 } // namespace keyboard | 464 } // namespace keyboard |
OLD | NEW |