Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: athena/home/home_card_impl.cc

Issue 668443002: Changes HomeCard to fullscreen from bottom when typing a query. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/home/athena_start_page_view_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index 9825d9246c7539e2032284a1f4e0bef7e99cb55f..9b2e49f620d73b3601c4596cf5664c462baf65e5 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -137,7 +137,8 @@ class HomeCardLayoutManager : public aura::LayoutManager {
};
// The container view of home card contents of each state.
-class HomeCardView : public views::WidgetDelegateView {
+class HomeCardView : public views::WidgetDelegateView,
+ public AthenaStartPageView::Observer {
public:
HomeCardView(app_list::AppListViewDelegate* view_delegate,
aura::Window* container,
@@ -149,9 +150,12 @@ class HomeCardView : public views::WidgetDelegateView {
// the home card.
// TODO(mukai): make it so after the detailed UI has been fixed.
main_view_ = new AthenaStartPageView(view_delegate);
+ main_view_->AddObserver(this);
AddChildView(main_view_);
}
+ virtual ~HomeCardView() { main_view_->RemoveObserver(this); }
+
void SetStateProgress(HomeCard::State from_state,
HomeCard::State to_state,
float progress) {
@@ -213,6 +217,12 @@ class HomeCardView : public views::WidgetDelegateView {
return this;
}
+ // AthenaStartPageView::Observer:
+ virtual void OnLayoutStateChanged(float new_state) override {
+ if (new_state == 1.0f)
+ HomeCard::Get()->SetState(HomeCard::VISIBLE_CENTERED);
+ }
+
AthenaStartPageView* main_view_;
scoped_ptr<HomeCardGestureManager> gesture_manager_;
HomeCardGestureManager::Delegate* gesture_delegate_;
« no previous file with comments | « athena/home/athena_start_page_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698