| 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/shell.h" | 9 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 10 #include "ash/system/status_area_widget.h" | 11 #include "ash/system/status_area_widget.h" |
| 11 #include "ash/system/status_area_widget_delegate.h" | 12 #include "ash/system/status_area_widget_delegate.h" |
| 12 #include "ash/system/tray/tray_constants.h" | 13 #include "ash/system/tray/tray_constants.h" |
| 13 #include "ash/wm/window_animations.h" | 14 #include "ash/wm/window_animations.h" |
| 14 #include "ui/aura/event_filter.h" | 15 #include "ui/aura/event_filter.h" |
| 15 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 16 #include "ui/base/accessibility/accessible_view_state.h" | 17 #include "ui/base/accessibility/accessible_view_state.h" |
| 17 #include "ui/compositor/layer_animation_observer.h" | 18 #include "ui/compositor/layer_animation_observer.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 background_ = new internal::TrayBackground; | 248 background_ = new internal::TrayBackground; |
| 248 tray_container_->set_background(background_); | 249 tray_container_->set_background(background_); |
| 249 } | 250 } |
| 250 | 251 |
| 251 void TrayBackgroundView::SetPaintsBackground( | 252 void TrayBackgroundView::SetPaintsBackground( |
| 252 bool value, | 253 bool value, |
| 253 internal::BackgroundAnimator::ChangeType change_type) { | 254 internal::BackgroundAnimator::ChangeType change_type) { |
| 254 hide_background_animator_.SetPaintsBackground(value, change_type); | 255 hide_background_animator_.SetPaintsBackground(value, change_type); |
| 255 } | 256 } |
| 256 | 257 |
| 258 ShelfLayoutManager* TrayBackgroundView::GetShelfLayoutManager() { |
| 259 return |
| 260 RootWindowController::ForLauncher(GetWidget()->GetNativeView())->shelf(); |
| 261 } |
| 262 |
| 257 void TrayBackgroundView::SetShelfAlignment(ShelfAlignment alignment) { | 263 void TrayBackgroundView::SetShelfAlignment(ShelfAlignment alignment) { |
| 258 shelf_alignment_ = alignment; | 264 shelf_alignment_ = alignment; |
| 259 SetBorder(); | 265 SetBorder(); |
| 260 tray_container_->SetAlignment(alignment); | 266 tray_container_->SetAlignment(alignment); |
| 261 } | 267 } |
| 262 | 268 |
| 263 void TrayBackgroundView::SetBorder() { | 269 void TrayBackgroundView::SetBorder() { |
| 264 views::View* parent = status_area_widget_->status_area_widget_delegate(); | 270 views::View* parent = status_area_widget_->status_area_widget_delegate(); |
| 265 // Tray views are laid out right-to-left or bottom-to-top | 271 // Tray views are laid out right-to-left or bottom-to-top |
| 266 int on_edge = (this == parent->child_at(0)); | 272 int on_edge = (this == parent->child_at(0)); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT; | 361 return TrayBubbleView::ANCHOR_ALIGNMENT_LEFT; |
| 356 case SHELF_ALIGNMENT_RIGHT: | 362 case SHELF_ALIGNMENT_RIGHT: |
| 357 return TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT; | 363 return TrayBubbleView::ANCHOR_ALIGNMENT_RIGHT; |
| 358 } | 364 } |
| 359 NOTREACHED(); | 365 NOTREACHED(); |
| 360 return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM; | 366 return TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM; |
| 361 } | 367 } |
| 362 | 368 |
| 363 } // namespace internal | 369 } // namespace internal |
| 364 } // namespace ash | 370 } // namespace ash |
| OLD | NEW |