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/shelf/shelf_widget.h" | 5 #include "ash/shelf/shelf_widget.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/session_state_delegate.h" | 10 #include "ash/session_state_delegate.h" |
| 11 #include "ash/shelf/shelf_constants.h" |
11 #include "ash/shelf/shelf_delegate.h" | 12 #include "ash/shelf/shelf_delegate.h" |
12 #include "ash/shelf/shelf_layout_manager.h" | 13 #include "ash/shelf/shelf_layout_manager.h" |
13 #include "ash/shelf/shelf_model.h" | 14 #include "ash/shelf/shelf_model.h" |
14 #include "ash/shelf/shelf_navigator.h" | 15 #include "ash/shelf/shelf_navigator.h" |
15 #include "ash/shelf/shelf_view.h" | 16 #include "ash/shelf/shelf_view.h" |
16 #include "ash/shelf/shelf_widget.h" | 17 #include "ash/shelf/shelf_widget.h" |
17 #include "ash/shell.h" | 18 #include "ash/shell.h" |
18 #include "ash/shell_window_ids.h" | 19 #include "ash/shell_window_ids.h" |
19 #include "ash/system/tray/system_tray_delegate.h" | 20 #include "ash/system/tray/system_tray_delegate.h" |
20 #include "ash/wm/status_area_layout_manager.h" | 21 #include "ash/wm/status_area_layout_manager.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 524 |
524 void ShelfWidget::DelegateView::UpdateBackground(int alpha) { | 525 void ShelfWidget::DelegateView::UpdateBackground(int alpha) { |
525 alpha_ = alpha; | 526 alpha_ = alpha; |
526 SchedulePaint(); | 527 SchedulePaint(); |
527 } | 528 } |
528 | 529 |
529 ShelfWidget::ShelfWidget(aura::Window* shelf_container, | 530 ShelfWidget::ShelfWidget(aura::Window* shelf_container, |
530 aura::Window* status_container, | 531 aura::Window* status_container, |
531 internal::WorkspaceController* workspace_controller) | 532 internal::WorkspaceController* workspace_controller) |
532 : delegate_view_(new DelegateView(this)), | 533 : delegate_view_(new DelegateView(this)), |
533 background_animator_(delegate_view_, 0, kLauncherBackgroundAlpha), | 534 background_animator_(delegate_view_, 0, kShelfBackgroundAlpha), |
534 activating_as_fallback_(false), | 535 activating_as_fallback_(false), |
535 window_container_(shelf_container) { | 536 window_container_(shelf_container) { |
536 views::Widget::InitParams params( | 537 views::Widget::InitParams params( |
537 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 538 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
538 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 539 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
539 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 540 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
540 params.parent = shelf_container; | 541 params.parent = shelf_container; |
541 params.delegate = delegate_view_; | 542 params.delegate = delegate_view_; |
542 Init(params); | 543 Init(params); |
543 | 544 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 DCHECK(delegate_view_); | 731 DCHECK(delegate_view_); |
731 return delegate_view_->disable_dimming_animations_for_test(); | 732 return delegate_view_->disable_dimming_animations_for_test(); |
732 } | 733 } |
733 | 734 |
734 void ShelfWidget::WillDeleteShelf() { | 735 void ShelfWidget::WillDeleteShelf() { |
735 shelf_layout_manager_->RemoveObserver(this); | 736 shelf_layout_manager_->RemoveObserver(this); |
736 shelf_layout_manager_ = NULL; | 737 shelf_layout_manager_ = NULL; |
737 } | 738 } |
738 | 739 |
739 } // namespace ash | 740 } // namespace ash |
OLD | NEW |