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

Unified Diff: athena/home/athena_start_page_view.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.h ('k') | athena/home/athena_start_page_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/athena_start_page_view.cc
diff --git a/athena/home/athena_start_page_view.cc b/athena/home/athena_start_page_view.cc
index 7058a84d53ad5eba8e78e847d0af2ea9d422379d..0891487fe98c52c452291c2740ae7dfbfae96902 100644
--- a/athena/home/athena_start_page_view.cc
+++ b/athena/home/athena_start_page_view.cc
@@ -244,6 +244,7 @@ void AthenaStartPageView::RequestFocusOnSearchBox() {
void AthenaStartPageView::SetLayoutState(float layout_state) {
layout_state_ = layout_state;
Layout();
+ FOR_EACH_OBSERVER(Observer, observers_, OnLayoutStateChanged(layout_state));
}
void AthenaStartPageView::SetLayoutStateWithAnimation(
@@ -268,6 +269,15 @@ void AthenaStartPageView::SetLayoutStateWithAnimation(
SetLayoutState(layout_state);
}
+void AthenaStartPageView::AddObserver(AthenaStartPageView::Observer* observer) {
+ observers_.AddObserver(observer);
+}
+
+void AthenaStartPageView::RemoveObserver(
+ AthenaStartPageView::Observer* observer) {
+ observers_.RemoveObserver(observer);
+}
+
AthenaStartPageView::LayoutData AthenaStartPageView::CreateBottomBounds(
int width) {
LayoutData state;
@@ -319,11 +329,8 @@ void AthenaStartPageView::LayoutSearchResults(bool should_show_search_results) {
search_results_view_->layer()->GetTargetVisibility()) {
return;
}
- if (GetContentsBounds().height() <= kHomeCardHeight) {
- search_results_view_->SetVisible(false);
- Layout();
- return;
- }
+ if (should_show_search_results && layout_state_ != 1.0f)
+ SetLayoutState(1.0f);
gfx::Rect search_box_bounds = search_box_container_->bounds();
if (!search_results_view_->visible()) {
« no previous file with comments | « athena/home/athena_start_page_view.h ('k') | athena/home/athena_start_page_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698