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