This source file includes following definitions.
- OnWindowResized
- OnWindowAddedToLayout
- SetChildBounds
- ResizeKeyboardToDefault
#include "ui/keyboard/keyboard_layout_manager.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/keyboard/keyboard_controller_proxy.h"
#include "ui/keyboard/keyboard_util.h"
namespace keyboard {
void KeyboardLayoutManager::OnWindowResized() {
if (keyboard_ && !controller_->proxy()->resizing_from_contents())
ResizeKeyboardToDefault(keyboard_);
}
void KeyboardLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
DCHECK(!keyboard_);
keyboard_ = child;
ResizeKeyboardToDefault(keyboard_);
}
void KeyboardLayoutManager::SetChildBounds(aura::Window* child,
const gfx::Rect& requested_bounds) {
if (controller_->proxy()->resizing_from_contents()) {
controller_->NotifyKeyboardBoundsChanging(requested_bounds);
SetChildBoundsDirect(child, requested_bounds);
}
}
void KeyboardLayoutManager::ResizeKeyboardToDefault(aura::Window* child) {
gfx::Rect keyboard_bounds = DefaultKeyboardBoundsFromWindowBounds(
controller_->GetContainerWindow()->bounds());
SetChildBoundsDirect(child, keyboard_bounds);
}
}