| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 container_->set_owned_by_parent(false); | 265 container_->set_owned_by_parent(false); |
| 266 container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 266 container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); |
| 267 container_->AddObserver(this); | 267 container_->AddObserver(this); |
| 268 container_->SetLayoutManager(new KeyboardLayoutManager(this)); | 268 container_->SetLayoutManager(new KeyboardLayoutManager(this)); |
| 269 } | 269 } |
| 270 return container_.get(); | 270 return container_.get(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void KeyboardController::NotifyKeyboardBoundsChanging( | 273 void KeyboardController::NotifyKeyboardBoundsChanging( |
| 274 const gfx::Rect& new_bounds) { | 274 const gfx::Rect& new_bounds) { |
| 275 if (proxy_->GetKeyboardWindow()->IsVisible()) { | 275 if (proxy_->HasKeyboardWindow() && proxy_->GetKeyboardWindow()->IsVisible()) { |
| 276 FOR_EACH_OBSERVER(KeyboardControllerObserver, | 276 FOR_EACH_OBSERVER(KeyboardControllerObserver, |
| 277 observer_list_, | 277 observer_list_, |
| 278 OnKeyboardBoundsChanging(new_bounds)); | 278 OnKeyboardBoundsChanging(new_bounds)); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 void KeyboardController::HideKeyboard(HideReason reason) { | 282 void KeyboardController::HideKeyboard(HideReason reason) { |
| 283 keyboard_visible_ = false; | 283 keyboard_visible_ = false; |
| 284 | 284 |
| 285 keyboard::LogKeyboardControlEvent( | 285 keyboard::LogKeyboardControlEvent( |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // background during animation. | 450 // background during animation. |
| 451 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); | 451 NotifyKeyboardBoundsChanging(proxy_->GetKeyboardWindow()->bounds()); |
| 452 proxy_->EnsureCaretInWorkArea(); | 452 proxy_->EnsureCaretInWorkArea(); |
| 453 } | 453 } |
| 454 | 454 |
| 455 void KeyboardController::HideAnimationFinished() { | 455 void KeyboardController::HideAnimationFinished() { |
| 456 proxy_->HideKeyboardContainer(container_.get()); | 456 proxy_->HideKeyboardContainer(container_.get()); |
| 457 } | 457 } |
| 458 | 458 |
| 459 } // namespace keyboard | 459 } // namespace keyboard |
| OLD | NEW |