Commit bf547ab8 authored by mukai's avatar mukai Committed by Commit bot

Hide the virtual keyboard when entering to overview mode.

BUG=413353
R=pkotwicz@chromium.org
TEST=athena_unittests

Review URL: https://codereview.chromium.org/566753003

Cr-Commit-Position: refs/heads/master@{#295500}
parent 4542ea08
......@@ -407,7 +407,7 @@ void HomeCardImpl::OnGestureProgressed(
}
void HomeCardImpl::OnOverviewModeEnter() {
if (state_ == VISIBLE_MINIMIZED)
if (state_ == HIDDEN || state_ == VISIBLE_MINIMIZED)
SetState(VISIBLE_BOTTOM);
}
......
......@@ -18,6 +18,7 @@
#include "ui/views/focus/focus_manager.h"
#include "ui/views/widget/widget.h"
#include "ui/wm/core/shadow_types.h"
#include "ui/wm/core/window_util.h"
namespace athena {
......@@ -82,10 +83,21 @@ TEST_F(HomeCardTest, VirtualKeyboardTransition) {
HomeCard::Get()->UpdateVirtualKeyboardBounds(gfx::Rect());
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
}
// Overview mode has to finish before ending test, otherwise it crashes.
// TODO(mukai): fix this.
TEST_F(HomeCardTest, ToggleOverviewWithVirtualKeyboard) {
// Minimized -> Hidden for virtual keyboard.
EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
const gfx::Rect vk_bounds(0, 0, 100, 100);
HomeCard::Get()->UpdateVirtualKeyboardBounds(vk_bounds);
EXPECT_EQ(HomeCard::HIDDEN, HomeCard::Get()->GetState());
// Toogle overview revives the bottom home card. Home card also gets
/// activated which will close the virtual keyboard.
WindowManager::GetInstance()->ToggleOverview();
EXPECT_EQ(HomeCard::VISIBLE_BOTTOM, HomeCard::Get()->GetState());
aura::Window* home_card = GetHomeCardWindow();
EXPECT_TRUE(wm::IsActiveWindow(home_card));
}
// Verify if the home card is correctly minimized after app launch.
......
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