| 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 "ash/system/tray/tray_background_view.h" | 5 #include "ash/system/tray/tray_background_view.h" |
| 6 | 6 |
| 7 #include "ash/launcher/background_animator.h" | 7 #include "ash/launcher/background_animator.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/status_area_widget.h" | 10 #include "ash/system/status_area_widget.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 void TrayBackgroundView::Initialize() { | 184 void TrayBackgroundView::Initialize() { |
| 185 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( | 185 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( |
| 186 layer_animation_observer_.get()); | 186 layer_animation_observer_.get()); |
| 187 SetBorder(); | 187 SetBorder(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) { | 190 void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) { |
| 191 hover_background_animator_.SetPaintsBackground(true, | 191 hover_background_animator_.SetPaintsBackground(true, |
| 192 internal::BackgroundAnimator::CHANGE_ANIMATE); | 192 internal::BackgroundAnimator::CHANGE_ANIMATE); |
| 193 UpdateShouldShowLauncher(); | |
| 194 } | 193 } |
| 195 | 194 |
| 196 void TrayBackgroundView::OnMouseExited(const ui::MouseEvent& event) { | 195 void TrayBackgroundView::OnMouseExited(const ui::MouseEvent& event) { |
| 197 hover_background_animator_.SetPaintsBackground(false, | 196 hover_background_animator_.SetPaintsBackground(false, |
| 198 internal::BackgroundAnimator::CHANGE_ANIMATE); | 197 internal::BackgroundAnimator::CHANGE_ANIMATE); |
| 199 UpdateShouldShowLauncher(); | |
| 200 } | 198 } |
| 201 | 199 |
| 202 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { | 200 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { |
| 203 PreferredSizeChanged(); | 201 PreferredSizeChanged(); |
| 204 } | 202 } |
| 205 | 203 |
| 206 void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) { | 204 void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| 207 // The tray itself expands to the right and bottom edge of the screen to make | 205 // The tray itself expands to the right and bottom edge of the screen to make |
| 208 // sure clicking on the edges brings up the popup. However, the focus border | 206 // sure clicking on the edges brings up the popup. However, the focus border |
| 209 // should be only around the container. | 207 // should be only around the container. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, | 270 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, |
| 273 kPaddingFromInnerEdgeOfLauncherVerticalAlignment)); | 271 kPaddingFromInnerEdgeOfLauncherVerticalAlignment)); |
| 274 } else { | 272 } else { |
| 275 set_border(views::Border::CreateEmptyBorder( | 273 set_border(views::Border::CreateEmptyBorder( |
| 276 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, | 274 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, |
| 277 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, | 275 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, |
| 278 kPaddingFromOuterEdgeOfLauncherVerticalAlignment)); | 276 kPaddingFromOuterEdgeOfLauncherVerticalAlignment)); |
| 279 } | 277 } |
| 280 } | 278 } |
| 281 | 279 |
| 282 void TrayBackgroundView::UpdateShouldShowLauncher() { | |
| 283 status_area_widget()->UpdateShouldShowLauncher(); | |
| 284 } | |
| 285 | |
| 286 } // namespace internal | 280 } // namespace internal |
| 287 } // namespace ash | 281 } // namespace ash |
| OLD | NEW |