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

[VK] Remove extraneous calls to NotifyKeyboardBoundsChanged.

In a previous CL, we made it so that changes to the keyboard window
bounds automatically call NotifyKeyboardBoundsChanged. Now we can
remove these extraneous calls and make NotifyKeyboardBoundsChanged
private.

TBR=jamescook@chromium.org

Bug: 845780
Change-Id: I191a22fc50e37a3c57552169f05f609f4fba3005
Reviewed-on: https://chromium-review.googlesource.com/1156114
Commit-Queue: Darren Shen <shend@chromium.org>
Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580079}
parent 6f7b2afb
......@@ -799,9 +799,6 @@ TEST_F(VirtualKeyboardRootWindowControllerTest, RestoreWorkspaceAfterLogin) {
gfx::Rect before =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
// Notify keyboard bounds changing.
controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds());
if (!keyboard::IsKeyboardOverscrollEnabled()) {
gfx::Rect after =
display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
......
......@@ -71,15 +71,14 @@ TEST_F(VirtualKeyboardAlwaysOnTopControllerTest, NotifyKeyboardBoundsChanging) {
// Activate keyboard. This triggers keyboard listeners to be registered.
controller->ActivateKeyboard(keyboard_controller);
// Mock a keyboard appearing.
aura::Window* contents_window =
keyboard_controller->ui()->GetKeyboardWindow();
// Show the keyboard.
keyboard_controller->ShowKeyboard(false /* locked */);
const int kKeyboardHeight = 200;
gfx::Rect keyboard_bounds = keyboard::KeyboardBoundsFromRootBounds(
root_window->bounds(), kKeyboardHeight);
contents_window->SetBounds(keyboard_bounds);
contents_window->Show();
keyboard_controller->NotifyKeyboardBoundsChanging(keyboard_bounds);
keyboard_controller->GetKeyboardWindow()->SetBounds(keyboard_bounds);
keyboard_controller->NotifyKeyboardWindowLoaded();
// Verify that test manager was notified of bounds change.
ASSERT_TRUE(manager->keyboard_bounds_changed());
}
......
......@@ -227,12 +227,8 @@ IN_PROC_BROWSER_TEST_F(VirtualKeyboardAppWindowTest,
gfx::Rect test_bounds(0, 0, 0, screen_height - ime_window_visible_height + 1);
auto* controller = keyboard::KeyboardController::Get();
controller->ShowKeyboard(true);
controller->ui()->GetKeyboardWindow()->SetBounds(test_bounds);
controller->NotifyKeyboardWindowLoaded();
gfx::Rect keyboard_bounds = controller->GetKeyboardWindow()->bounds();
// Starts overscroll.
controller->NotifyKeyboardBoundsChanging(keyboard_bounds);
controller->GetKeyboardWindow()->SetBounds(test_bounds);
// Non ime window should have smaller visible view port due to overlap with
// virtual keyboard.
......
......@@ -107,10 +107,6 @@ class KEYBOARD_EXPORT KeyboardController
// loaded yet.
void Reload();
// Notifies observers that the visual or occluded bounds of the keyboard
// window are changing.
void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds);
// Management of the observer list.
void AddObserver(KeyboardControllerObserver* observer);
bool HasObserver(KeyboardControllerObserver* observer) const;
......@@ -308,6 +304,10 @@ class KEYBOARD_EXPORT KeyboardController
// Only called from |UpdateKeyboardConfig| in keyboard_util.
void NotifyKeyboardConfigChanged();
// Notifies observers that the visual or occluded bounds of the keyboard
// window are changing.
void NotifyKeyboardBoundsChanging(const gfx::Rect& new_bounds);
// Validates the state transition. Called from ChangeState.
void CheckStateTransition(KeyboardControllerState prev,
KeyboardControllerState next);
......
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