Chromium Code Reviews| Index: athena/home/home_card_impl.cc |
| diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc |
| index 7b73bc241d21429f7f376ccfdea34e0617159554..91ec8f651b81707b7dd2742d4aa30d8be77e6a52 100644 |
| --- a/athena/home/home_card_impl.cc |
| +++ b/athena/home/home_card_impl.cc |
| @@ -16,6 +16,7 @@ |
| #include "athena/screen/public/screen_manager.h" |
| #include "athena/wm/public/window_manager.h" |
| #include "athena/wm/public/window_manager_observer.h" |
| +#include "base/auto_reset.h" |
| #include "base/bind.h" |
| #include "base/memory/weak_ptr.h" |
| #include "ui/app_list/search_provider.h" |
| @@ -452,6 +453,9 @@ class HomeCardImpl : public HomeCard, |
| // the virtual keyboard is hidden. |
| HomeCard::State original_state_; |
| + // The state to be entered when the overview mode is turned on. |
| + HomeCard::State overview_mode_state_; |
| + |
| views::Widget* home_card_widget_; |
| HomeCardView* home_card_view_; |
| scoped_ptr<AppListViewDelegate> view_delegate_; |
| @@ -469,6 +473,7 @@ HomeCardImpl::HomeCardImpl(AppModelBuilder* model_builder) |
| : model_builder_(model_builder), |
| state_(HIDDEN), |
| original_state_(VISIBLE_MINIMIZED), |
| + overview_mode_state_(VISIBLE_BOTTOM), |
| home_card_widget_(NULL), |
| home_card_view_(NULL), |
| layout_manager_(NULL), |
| @@ -606,6 +611,8 @@ void HomeCardImpl::OnGestureEnded(State final_state) { |
| home_card_view_->ClearGesture(); |
| if (state_ != final_state && |
|
oshima
2014/08/25 20:47:10
can exit early if skip if state_ == final_state?
Jun Mukai
2014/08/25 21:09:05
That will cause a test failure. Also, the home car
oshima
2014/08/25 21:20:25
Acknowledged.
|
| (state_ == VISIBLE_MINIMIZED || final_state == VISIBLE_MINIMIZED)) { |
| + base::AutoReset<HomeCard::State> overview_mode( |
| + &overview_mode_state_, final_state); |
| WindowManager::GetInstance()->ToggleOverview(); |
| } else { |
| HomeCard::State old_state = state_; |
| @@ -631,7 +638,7 @@ void HomeCardImpl::OnGestureProgressed( |
| } |
| void HomeCardImpl::OnOverviewModeEnter() { |
| - SetState(VISIBLE_BOTTOM); |
| + SetState(overview_mode_state_); |
| } |
| void HomeCardImpl::OnOverviewModeExit() { |