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