| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "athena/home/athena_start_page_view.h" | 5 #include "athena/home/athena_start_page_view.h" |
| 6 | 6 |
| 7 #include "athena/home/home_card_constants.h" | 7 #include "athena/home/home_card_constants.h" |
| 8 #include "athena/system/public/system_ui.h" | 8 #include "athena/system/public/system_ui.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 void AthenaStartPageView::RequestFocusOnSearchBox() { | 240 void AthenaStartPageView::RequestFocusOnSearchBox() { |
| 241 search_box_view_->search_box()->RequestFocus(); | 241 search_box_view_->search_box()->RequestFocus(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void AthenaStartPageView::SetLayoutState(float layout_state) { | 244 void AthenaStartPageView::SetLayoutState(float layout_state) { |
| 245 layout_state_ = layout_state; | 245 layout_state_ = layout_state; |
| 246 Layout(); | 246 Layout(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void AthenaStartPageView::SetLayoutStateWithAnimation(float layout_state) { | 249 void AthenaStartPageView::SetLayoutStateWithAnimation( |
| 250 float layout_state, |
| 251 gfx::Tween::Type tween_type) { |
| 250 ui::ScopedLayerAnimationSettings system_info( | 252 ui::ScopedLayerAnimationSettings system_info( |
| 251 system_info_view_->layer()->GetAnimator()); | 253 system_info_view_->layer()->GetAnimator()); |
| 252 ui::ScopedLayerAnimationSettings logo(logo_->layer()->GetAnimator()); | 254 ui::ScopedLayerAnimationSettings logo(logo_->layer()->GetAnimator()); |
| 253 ui::ScopedLayerAnimationSettings search_box( | 255 ui::ScopedLayerAnimationSettings search_box( |
| 254 search_box_container_->layer()->GetAnimator()); | 256 search_box_container_->layer()->GetAnimator()); |
| 255 ui::ScopedLayerAnimationSettings icons( | 257 ui::ScopedLayerAnimationSettings icons( |
| 256 app_icon_container_->layer()->GetAnimator()); | 258 app_icon_container_->layer()->GetAnimator()); |
| 257 ui::ScopedLayerAnimationSettings controls( | 259 ui::ScopedLayerAnimationSettings controls( |
| 258 control_icon_container_->layer()->GetAnimator()); | 260 control_icon_container_->layer()->GetAnimator()); |
| 259 | 261 |
| 260 system_info.SetTweenType(gfx::Tween::EASE_IN_OUT); | 262 system_info.SetTweenType(tween_type); |
| 261 logo.SetTweenType(gfx::Tween::EASE_IN_OUT); | 263 logo.SetTweenType(tween_type); |
| 262 search_box.SetTweenType(gfx::Tween::EASE_IN_OUT); | 264 search_box.SetTweenType(tween_type); |
| 263 icons.SetTweenType(gfx::Tween::EASE_IN_OUT); | 265 icons.SetTweenType(tween_type); |
| 264 controls.SetTweenType(gfx::Tween::EASE_IN_OUT); | 266 controls.SetTweenType(tween_type); |
| 265 | 267 |
| 266 SetLayoutState(layout_state); | 268 SetLayoutState(layout_state); |
| 267 } | 269 } |
| 268 | 270 |
| 269 AthenaStartPageView::LayoutData AthenaStartPageView::CreateBottomBounds( | 271 AthenaStartPageView::LayoutData AthenaStartPageView::CreateBottomBounds( |
| 270 int width) { | 272 int width) { |
| 271 LayoutData state; | 273 LayoutData state; |
| 272 state.icons.set_size(app_icon_container_->size()); | 274 state.icons.set_size(app_icon_container_->size()); |
| 273 state.icons.set_x(kIconMargin); | 275 state.icons.set_x(kIconMargin); |
| 274 state.icons.set_y(kIconMargin); | 276 state.icons.set_y(kIconMargin); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 base::TrimWhitespace( | 432 base::TrimWhitespace( |
| 431 delegate_->GetModel()->search_box()->text(), base::TRIM_ALL, &query); | 433 delegate_->GetModel()->search_box()->text(), base::TRIM_ALL, &query); |
| 432 | 434 |
| 433 if (!query.empty()) | 435 if (!query.empty()) |
| 434 search_results_view_->SetSelectedIndex(0); | 436 search_results_view_->SetSelectedIndex(0); |
| 435 | 437 |
| 436 LayoutSearchResults(!query.empty()); | 438 LayoutSearchResults(!query.empty()); |
| 437 } | 439 } |
| 438 | 440 |
| 439 } // namespace athena | 441 } // namespace athena |
| OLD | NEW |