Commit 78354191 authored by kalman@chromium.org's avatar kalman@chromium.org

Revert 285393 "Exit overview mode when a new activity is opened ..."

Broke HomeCardTest.Accelerators:
http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/46117

> Exit overview mode when a new activity is opened in athena.
> 
> This has the side effect of fixing the crash in 396368
> 
> BUG=396368
> TEST=Manual, see bug
> 
> Review URL: https://codereview.chromium.org/411813002

TBR=pkotwicz@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285398 0039d316-1c4b-4281-b951-d872f2087c98
parent 61823d7c
......@@ -57,6 +57,10 @@ TEST_F(HomeCardTest, AppSelection) {
athena::ActivityFactory::Get()->CreateWebActivity(
NULL, GURL("http://www.google.com/")));
EXPECT_EQ(HomeCard::VISIBLE_MINIMIZED, HomeCard::Get()->GetState());
// Overview mode has to finish before ending test, otherwise it crashes.
// TODO(mukai): fix this.
WindowManager::GetInstance()->ToggleOverview();
}
TEST_F(HomeCardTest, Accelerators) {
......@@ -80,6 +84,10 @@ TEST_F(HomeCardTest, Accelerators) {
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
generator.PressKey(ui::VKEY_L, ui::EF_CONTROL_DOWN);
EXPECT_EQ(HomeCard::VISIBLE_CENTERED, HomeCard::Get()->GetState());
// Overview mode has to finish before ending test, otherwise it crashes.
// TODO(mukai): fix this.
WindowManager::GetInstance()->ToggleOverview();
}
} // namespace athena
......@@ -39,9 +39,6 @@ class WindowManagerImpl : public WindowManager,
COMMAND_TOGGLE_OVERVIEW,
};
// Sets whether overview mode is active.
void SetInOverview(bool active);
void InstallAccelerators();
// WindowManager:
......@@ -115,7 +112,6 @@ WindowManagerImpl::~WindowManagerImpl() {
void WindowManagerImpl::Layout() {
if (!container_)
return;
SetInOverview(false);
gfx::Rect bounds = gfx::Rect(container_->bounds().size());
const aura::Window::Windows& children = container_->children();
for (aura::Window::Windows::const_iterator iter = children.begin();
......@@ -128,22 +124,14 @@ void WindowManagerImpl::Layout() {
}
void WindowManagerImpl::ToggleOverview() {
SetInOverview(overview_.get() == NULL);
}
void WindowManagerImpl::SetInOverview(bool active) {
bool in_overview = !!overview_;
if (active == in_overview)
return;
if (active) {
overview_ = WindowOverviewMode::Create(container_.get(), this);
FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
OnOverviewModeEnter());
} else {
if (overview_) {
overview_.reset();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
OnOverviewModeExit());
} else {
overview_ = WindowOverviewMode::Create(container_.get(), this);
FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
OnOverviewModeEnter());
}
}
......@@ -168,7 +156,9 @@ void WindowManagerImpl::OnSelectWindow(aura::Window* window) {
CHECK_EQ(container_.get(), window->parent());
container_->StackChildAtTop(window);
wm::ActivateWindow(window);
SetInOverview(false);
overview_.reset();
FOR_EACH_OBSERVER(WindowManagerObserver, observers_,
OnOverviewModeExit());
}
void WindowManagerImpl::OnWindowDestroying(aura::Window* window) {
......
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