| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 void TrayBackgroundView::Initialize() { | 181 void TrayBackgroundView::Initialize() { |
| 182 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( | 182 GetWidget()->GetNativeView()->layer()->GetAnimator()->AddObserver( |
| 183 layer_animation_observer_.get()); | 183 layer_animation_observer_.get()); |
| 184 SetBorder(); | 184 SetBorder(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) { | 187 void TrayBackgroundView::OnMouseEntered(const ui::MouseEvent& event) { |
| 188 hover_background_animator_.SetPaintsBackground(true, | 188 hover_background_animator_.SetPaintsBackground(true, |
| 189 internal::BackgroundAnimator::CHANGE_ANIMATE); | 189 internal::BackgroundAnimator::CHANGE_ANIMATE); |
| 190 UpdateShouldShowLauncher(); |
| 190 } | 191 } |
| 191 | 192 |
| 192 void TrayBackgroundView::OnMouseExited(const ui::MouseEvent& event) { | 193 void TrayBackgroundView::OnMouseExited(const ui::MouseEvent& event) { |
| 193 hover_background_animator_.SetPaintsBackground(false, | 194 hover_background_animator_.SetPaintsBackground(false, |
| 194 internal::BackgroundAnimator::CHANGE_ANIMATE); | 195 internal::BackgroundAnimator::CHANGE_ANIMATE); |
| 196 UpdateShouldShowLauncher(); |
| 195 } | 197 } |
| 196 | 198 |
| 197 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { | 199 void TrayBackgroundView::ChildPreferredSizeChanged(views::View* child) { |
| 198 PreferredSizeChanged(); | 200 PreferredSizeChanged(); |
| 199 } | 201 } |
| 200 | 202 |
| 201 void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) { | 203 void TrayBackgroundView::OnPaintFocusBorder(gfx::Canvas* canvas) { |
| 202 // The tray itself expands to the right and bottom edge of the screen to make | 204 // The tray itself expands to the right and bottom edge of the screen to make |
| 203 // sure clicking on the edges brings up the popup. However, the focus border | 205 // sure clicking on the edges brings up the popup. However, the focus border |
| 204 // should be only around the container. | 206 // should be only around the container. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, | 263 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, |
| 262 kPaddingFromInnerEdgeOfLauncherVerticalAlignment)); | 264 kPaddingFromInnerEdgeOfLauncherVerticalAlignment)); |
| 263 } else { | 265 } else { |
| 264 set_border(views::Border::CreateEmptyBorder( | 266 set_border(views::Border::CreateEmptyBorder( |
| 265 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, | 267 0, kPaddingFromInnerEdgeOfLauncherVerticalAlignment, |
| 266 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, | 268 on_edge ? kPaddingFromBottomOfScreenVerticalAlignment : 0, |
| 267 kPaddingFromOuterEdgeOfLauncherVerticalAlignment)); | 269 kPaddingFromOuterEdgeOfLauncherVerticalAlignment)); |
| 268 } | 270 } |
| 269 } | 271 } |
| 270 | 272 |
| 273 void TrayBackgroundView::UpdateShouldShowLauncher() { |
| 274 status_area_widget()->UpdateShouldShowLauncher(); |
| 275 } |
| 276 |
| 271 } // namespace internal | 277 } // namespace internal |
| 272 } // namespace ash | 278 } // namespace ash |
| OLD | NEW |