| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 animation_observer_->SetTarget(overlay_view_); | 269 animation_observer_->SetTarget(overlay_view_); |
| 270 settings.AddObserver(animation_observer_.get()); | 270 settings.AddObserver(animation_observer_.get()); |
| 271 } | 271 } |
| 272 | 272 |
| 273 const float kOverlayFadeInMilliseconds = 125; | 273 const float kOverlayFadeInMilliseconds = 125; |
| 274 settings.SetTransitionDuration( | 274 settings.SetTransitionDuration( |
| 275 base::TimeDelta::FromMilliseconds(kOverlayFadeInMilliseconds)); | 275 base::TimeDelta::FromMilliseconds(kOverlayFadeInMilliseconds)); |
| 276 | 276 |
| 277 const float kOverlayOpacity = 0.75f; | 277 const float kOverlayOpacity = 0.75f; |
| 278 overlay_view_->layer()->SetOpacity(visible ? kOverlayOpacity : 0.0f); | 278 overlay_view_->layer()->SetOpacity(visible ? kOverlayOpacity : 0.0f); |
| 279 // Create the illusion that the search box is hidden behind the app list |
| 280 // overlay mask by setting its opacity to the same value, and disabling it. |
| 281 { |
| 282 ui::ScopedLayerAnimationSettings settings( |
| 283 search_box_widget_->GetLayer()->GetAnimator()); |
| 284 const float kSearchBoxWidgetOpacity = 0.5f; |
| 285 search_box_widget_->GetLayer()->SetOpacity(visible ? kSearchBoxWidgetOpacity |
| 286 : 1.0f); |
| 287 search_box_view_->SetEnabled(!visible); |
| 288 } |
| 279 } | 289 } |
| 280 | 290 |
| 281 bool AppListView::ShouldCenterWindow() const { | 291 bool AppListView::ShouldCenterWindow() const { |
| 282 return delegate_->ShouldCenterWindow(); | 292 return delegate_->ShouldCenterWindow(); |
| 283 } | 293 } |
| 284 | 294 |
| 285 gfx::Size AppListView::GetPreferredSize() const { | 295 gfx::Size AppListView::GetPreferredSize() const { |
| 286 return app_list_main_view_->GetPreferredSize(); | 296 return app_list_main_view_->GetPreferredSize(); |
| 287 } | 297 } |
| 288 | 298 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 703 |
| 694 if (will_appear) { | 704 if (will_appear) { |
| 695 speech_view_->SetVisible(true); | 705 speech_view_->SetVisible(true); |
| 696 } else { | 706 } else { |
| 697 app_list_main_view_->SetVisible(true); | 707 app_list_main_view_->SetVisible(true); |
| 698 search_box_view_->search_box()->RequestFocus(); | 708 search_box_view_->search_box()->RequestFocus(); |
| 699 } | 709 } |
| 700 } | 710 } |
| 701 | 711 |
| 702 } // namespace app_list | 712 } // namespace app_list |
| OLD | NEW |