summaryrefslogtreecommitdiffstats
path: root/athena/home/home_card_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'athena/home/home_card_impl.cc')
-rw-r--r--athena/home/home_card_impl.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index 2e7cdd1..da75954 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -134,6 +134,7 @@ HomeCardImpl::~HomeCardImpl() {
// Reset the view delegate first as it access search provider during
// shutdown.
+ view_delegate_->GetModel()->RemoveObserver(this);
view_delegate_.reset();
instance = nullptr;
}
@@ -151,6 +152,7 @@ void HomeCardImpl::Init() {
view_delegate_.reset(
new AppListViewDelegate(model_builder_.get(), search_factory_.get()));
+ view_delegate_->GetModel()->AddObserver(this);
home_card_view_ = new HomeCardView(view_delegate_.get(), this);
home_card_widget_ = new views::Widget();
views::Widget::InitParams widget_params(
@@ -305,6 +307,20 @@ void HomeCardImpl::OnSplitViewModeEnter() {
void HomeCardImpl::OnSplitViewModeExit() {
}
+void HomeCardImpl::OnAppListModelStateChanged(
+ app_list::AppListModel::State old_state,
+ app_list::AppListModel::State new_state) {
+ // State change should not happen in minimized mode.
+ DCHECK_NE(VISIBLE_MINIMIZED, state_);
+
+ if (state_ == VISIBLE_BOTTOM) {
+ if (old_state == app_list::AppListModel::STATE_START)
+ SetState(VISIBLE_CENTERED);
+ else
+ DCHECK_EQ(app_list::AppListModel::STATE_START, new_state);
+ }
+}
+
// static
HomeCard* HomeCard::Create(scoped_ptr<AppModelBuilder> model_builder,
scoped_ptr<SearchControllerFactory> search_factory) {