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/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
11 #include "ash/system/status_area_widget.h" | 11 #include "ash/system/status_area_widget.h" |
12 #include "ash/system/status_area_widget_delegate.h" | 12 #include "ash/system/status_area_widget_delegate.h" |
13 #include "ash/system/tray/tray_constants.h" | 13 #include "ash/system/tray/tray_constants.h" |
14 #include "ash/wm/property_util.h" | 14 #include "ash/wm/property_util.h" |
15 #include "ash/wm/shelf_layout_manager.h" | 15 #include "ash/wm/shelf_layout_manager.h" |
16 #include "ash/wm/window_animations.h" | 16 #include "ash/wm/window_animations.h" |
17 #include "ui/aura/root_window.h" | 17 #include "ui/aura/root_window.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/base/accessibility/accessible_view_state.h" | 19 #include "ui/base/accessibility/accessible_view_state.h" |
20 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 21 #include "ui/gfx/rect.h" |
21 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
22 #include "ui/gfx/skia_util.h" | 23 #include "ui/gfx/skia_util.h" |
23 #include "ui/views/background.h" | 24 #include "ui/views/background.h" |
24 #include "ui/views/layout/box_layout.h" | 25 #include "ui/views/layout/box_layout.h" |
25 | 26 |
26 namespace { | 27 namespace { |
27 | 28 |
28 const SkColor kTrayBackgroundAlpha = 100; | 29 const SkColor kTrayBackgroundAlpha = 100; |
29 const SkColor kTrayBackgroundHoverAlpha = 150; | 30 const SkColor kTrayBackgroundHoverAlpha = 150; |
30 | 31 |
(...skipping 13 matching lines...) Expand all Loading... |
44 namespace internal { | 45 namespace internal { |
45 | 46 |
46 // Used to track when the anchor widget changes position on screen so that the | 47 // Used to track when the anchor widget changes position on screen so that the |
47 // bubble position can be updated. | 48 // bubble position can be updated. |
48 class TrayBackgroundView::TrayWidgetObserver : public views::WidgetObserver { | 49 class TrayBackgroundView::TrayWidgetObserver : public views::WidgetObserver { |
49 public: | 50 public: |
50 explicit TrayWidgetObserver(TrayBackgroundView* host) | 51 explicit TrayWidgetObserver(TrayBackgroundView* host) |
51 : host_(host) { | 52 : host_(host) { |
52 } | 53 } |
53 | 54 |
54 virtual void OnWidgetMoved(views::Widget* widget) OVERRIDE { | 55 virtual void OnWidgetBoundsChanged(views::Widget* widget, |
| 56 const gfx::Rect& new_bounds) OVERRIDE { |
55 host_->AnchorUpdated(); | 57 host_->AnchorUpdated(); |
56 } | 58 } |
57 | 59 |
58 virtual void OnWidgetVisibilityChanged(views::Widget* widget, | 60 virtual void OnWidgetVisibilityChanged(views::Widget* widget, |
59 bool visible) OVERRIDE { | 61 bool visible) OVERRIDE { |
60 host_->AnchorUpdated(); | 62 host_->AnchorUpdated(); |
61 } | 63 } |
62 | 64 |
63 private: | 65 private: |
64 TrayBackgroundView* host_; | 66 TrayBackgroundView* host_; |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 views::TrayBubbleView* bubble_view) { | 370 views::TrayBubbleView* bubble_view) { |
369 aura::RootWindow* root_window = | 371 aura::RootWindow* root_window = |
370 bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); | 372 bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); |
371 ash::internal::ShelfLayoutManager* shelf = | 373 ash::internal::ShelfLayoutManager* shelf = |
372 ash::GetRootWindowController(root_window)->shelf(); | 374 ash::GetRootWindowController(root_window)->shelf(); |
373 bubble_view->SetPaintArrow(shelf->IsVisible()); | 375 bubble_view->SetPaintArrow(shelf->IsVisible()); |
374 } | 376 } |
375 | 377 |
376 } // namespace internal | 378 } // namespace internal |
377 } // namespace ash | 379 } // namespace ash |
OLD | NEW |