Commit 86231376 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

[VK] Remove unused WindowObserver events.

KeyboardController listens to WindowObserver events on the parent
container window. It updates the observer whenever the keyboard moves
to a different display by removing the observer on the old root window
and adding the observer on the new root window. See original patch
that added the code:
https://crrev.com/1008453002

We don't really need to do this as we already do that in Activate/
Deactivate keyboard.

Bug: 845780
Change-Id: Idc25d5beadbe1f2233e184fd1c189a3fde05aa50
Reviewed-on: https://chromium-review.googlesource.com/1113714
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570970}
parent 91f94dcf
...@@ -515,15 +515,8 @@ void KeyboardController::OnWindowHierarchyChanged( ...@@ -515,15 +515,8 @@ void KeyboardController::OnWindowHierarchyChanged(
} }
void KeyboardController::OnWindowAddedToRootWindow(aura::Window* window) { void KeyboardController::OnWindowAddedToRootWindow(aura::Window* window) {
if (!window->GetRootWindow()->HasObserver(this)) container_behavior_->SetCanonicalBounds(GetContentsWindow(),
window->GetRootWindow()->AddObserver(this); GetRootWindow()->bounds());
AdjustKeyboardBounds();
}
void KeyboardController::OnWindowRemovingFromRootWindow(aura::Window* window,
aura::Window* new_root) {
if (window->GetRootWindow()->HasObserver(this))
window->GetRootWindow()->RemoveObserver(this);
} }
void KeyboardController::OnWindowBoundsChanged( void KeyboardController::OnWindowBoundsChanged(
...@@ -723,11 +716,6 @@ void KeyboardController::NotifyKeyboardConfigChanged() { ...@@ -723,11 +716,6 @@ void KeyboardController::NotifyKeyboardConfigChanged() {
observer.OnKeyboardConfigChanged(); observer.OnKeyboardConfigChanged();
} }
void KeyboardController::AdjustKeyboardBounds() {
container_behavior_->SetCanonicalBounds(GetContentsWindow(),
GetRootWindow()->bounds());
}
void KeyboardController::CheckStateTransition(KeyboardControllerState prev, void KeyboardController::CheckStateTransition(KeyboardControllerState prev,
KeyboardControllerState next) { KeyboardControllerState next) {
std::stringstream error_message; std::stringstream error_message;
......
...@@ -271,8 +271,6 @@ class KEYBOARD_EXPORT KeyboardController ...@@ -271,8 +271,6 @@ class KEYBOARD_EXPORT KeyboardController
// aura::WindowObserver overrides // aura::WindowObserver overrides
void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override;
void OnWindowAddedToRootWindow(aura::Window* window) override; void OnWindowAddedToRootWindow(aura::Window* window) override;
void OnWindowRemovingFromRootWindow(aura::Window* window,
aura::Window* new_root) override;
void OnWindowBoundsChanged(aura::Window* window, void OnWindowBoundsChanged(aura::Window* window,
const gfx::Rect& old_bounds, const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds, const gfx::Rect& new_bounds,
...@@ -309,10 +307,6 @@ class KEYBOARD_EXPORT KeyboardController ...@@ -309,10 +307,6 @@ class KEYBOARD_EXPORT KeyboardController
void NotifyKeyboardBoundsChangingAndEnsureCaretInWorkArea(); void NotifyKeyboardBoundsChangingAndEnsureCaretInWorkArea();
// Called when the keyboard mode is set or the keyboard is moved to another
// display.
void AdjustKeyboardBounds();
// Notifies keyboard config change to the observers. // Notifies keyboard config change to the observers.
// Only called from |UpdateKeyboardConfig| in keyboard_util. // Only called from |UpdateKeyboardConfig| in keyboard_util.
void NotifyKeyboardConfigChanged(); void NotifyKeyboardConfigChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment