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 b5b8df565ef346740e27453dc70f29fe5861710f..40286782c52a1e861ae49ad1b46820f4ec29fdb4 100644 |
--- a/athena/home/athena_start_page_view.cc |
+++ b/athena/home/athena_start_page_view.cc |
@@ -5,6 +5,7 @@ |
#include "athena/home/athena_start_page_view.h" |
#include "athena/home/home_card_constants.h" |
+#include "athena/system/public/system_ui.h" |
#include "base/bind.h" |
#include "base/strings/string_util.h" |
#include "third_party/skia/include/core/SkPaint.h" |
@@ -155,7 +156,8 @@ namespace athena { |
const char AthenaStartPageView::kViewClassName[] = "AthenaStartPageView"; |
AthenaStartPageView::LayoutData::LayoutData() |
- : logo_opacity(1.0f), |
+ : system_info_opacity(1.0f), |
+ logo_opacity(1.0f), |
background_opacity(1.0f) { |
} |
@@ -171,6 +173,12 @@ AthenaStartPageView::AthenaStartPageView( |
background_->SetFillsBoundsOpaquely(false); |
AddChildView(background_); |
+ system_info_view_ = |
+ SystemUI::Get()->CreateSystemInfoView(SystemUI::COLOR_SCHEME_DARK); |
+ system_info_view_->SetPaintToLayer(true); |
+ system_info_view_->SetFillsBoundsOpaquely(false); |
+ AddChildView(system_info_view_); |
+ |
logo_ = view_delegate->CreateStartPageWebView( |
gfx::Size(kWebViewWidth, kWebViewHeight)); |
logo_->SetPaintToLayer(true); |
@@ -234,6 +242,8 @@ void AthenaStartPageView::SetLayoutState(float layout_state) { |
} |
void AthenaStartPageView::SetLayoutStateWithAnimation(float layout_state) { |
+ ui::ScopedLayerAnimationSettings system_info( |
+ system_info_view_->layer()->GetAnimator()); |
ui::ScopedLayerAnimationSettings logo(logo_->layer()->GetAnimator()); |
ui::ScopedLayerAnimationSettings search_box( |
search_box_container_->layer()->GetAnimator()); |
@@ -242,6 +252,7 @@ void AthenaStartPageView::SetLayoutStateWithAnimation(float layout_state) { |
ui::ScopedLayerAnimationSettings controls( |
control_icon_container_->layer()->GetAnimator()); |
+ system_info.SetTweenType(gfx::Tween::EASE_IN_OUT); |
logo.SetTweenType(gfx::Tween::EASE_IN_OUT); |
search_box.SetTweenType(gfx::Tween::EASE_IN_OUT); |
icons.SetTweenType(gfx::Tween::EASE_IN_OUT); |
@@ -268,6 +279,7 @@ AthenaStartPageView::LayoutData AthenaStartPageView::CreateBottomBounds( |
state.search_box.set_x((width - state.search_box.width()) / 2); |
state.search_box.set_y((kHomeCardHeight - state.search_box.height()) / 2); |
+ state.system_info_opacity = 0.0f; |
state.logo_opacity = 0.0f; |
state.background_opacity = 0.9f; |
return state; |
@@ -289,6 +301,7 @@ AthenaStartPageView::LayoutData AthenaStartPageView::CreateCenteredBounds( |
state.controls.set_x(width / 2 + kIconMargin / 2 + kIconMargin % 2); |
state.controls.set_y(state.icons.y()); |
+ state.system_info_opacity = 1.0f; |
state.logo_opacity = 1.0f; |
state.background_opacity = 1.0f; |
return state; |
@@ -364,6 +377,10 @@ void AthenaStartPageView::OnSearchResultLayoutAnimationCompleted( |
void AthenaStartPageView::Layout() { |
search_results_view_->SetVisible(false); |
+ |
+ system_info_view_->SetBounds( |
+ 0, 0, width(), system_info_view_->GetPreferredSize().height()); |
+ |
gfx::Rect logo_bounds(x() + width() / 2 - kWebViewWidth / 2, y() + kTopMargin, |
kWebViewWidth, kWebViewHeight); |
logo_->SetBoundsRect(logo_bounds); |
@@ -371,6 +388,12 @@ void AthenaStartPageView::Layout() { |
LayoutData bottom_bounds = CreateBottomBounds(width()); |
LayoutData centered_bounds = CreateCenteredBounds(width()); |
+ system_info_view_->layer()->SetOpacity(gfx::Tween::FloatValueBetween( |
+ gfx::Tween::CalculateValue(gfx::Tween::EASE_IN_2, layout_state_), |
+ bottom_bounds.system_info_opacity, centered_bounds.system_info_opacity)); |
+ system_info_view_->SetVisible( |
+ system_info_view_->layer()->GetTargetOpacity() != 0.0f); |
+ |
logo_->layer()->SetOpacity(gfx::Tween::FloatValueBetween( |
gfx::Tween::CalculateValue(gfx::Tween::EASE_IN_2, layout_state_), |
bottom_bounds.logo_opacity, centered_bounds.logo_opacity)); |