| 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/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 //////////////////////////////////////////////////////////////////////////////// | 160 //////////////////////////////////////////////////////////////////////////////// |
| 161 // TrayBackgroundView | 161 // TrayBackgroundView |
| 162 | 162 |
| 163 TrayBackgroundView::TrayBackgroundView( | 163 TrayBackgroundView::TrayBackgroundView( |
| 164 internal::StatusAreaWidget* status_area_widget) | 164 internal::StatusAreaWidget* status_area_widget) |
| 165 : status_area_widget_(status_area_widget), | 165 : status_area_widget_(status_area_widget), |
| 166 tray_container_(NULL), | 166 tray_container_(NULL), |
| 167 shelf_alignment_(SHELF_ALIGNMENT_BOTTOM), | 167 shelf_alignment_(SHELF_ALIGNMENT_BOTTOM), |
| 168 background_(NULL), | 168 background_(NULL), |
| 169 ALLOW_THIS_IN_INITIALIZER_LIST(hide_background_animator_( | 169 hide_background_animator_(this, 0, kTrayBackgroundAlpha), |
| 170 this, 0, kTrayBackgroundAlpha)), | 170 hover_background_animator_( |
| 171 ALLOW_THIS_IN_INITIALIZER_LIST(hover_background_animator_( | 171 this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha), |
| 172 this, 0, kTrayBackgroundHoverAlpha - kTrayBackgroundAlpha)), | 172 widget_observer_(new TrayWidgetObserver(this)) { |
| 173 ALLOW_THIS_IN_INITIALIZER_LIST(widget_observer_( | |
| 174 new TrayWidgetObserver(this))) { | |
| 175 set_notify_enter_exit_on_child(true); | 173 set_notify_enter_exit_on_child(true); |
| 176 | 174 |
| 177 // Initially we want to paint the background, but without the hover effect. | 175 // Initially we want to paint the background, but without the hover effect. |
| 178 SetPaintsBackground(true, internal::BackgroundAnimator::CHANGE_IMMEDIATE); | 176 SetPaintsBackground(true, internal::BackgroundAnimator::CHANGE_IMMEDIATE); |
| 179 hover_background_animator_.SetPaintsBackground(false, | 177 hover_background_animator_.SetPaintsBackground(false, |
| 180 internal::BackgroundAnimator::CHANGE_IMMEDIATE); | 178 internal::BackgroundAnimator::CHANGE_IMMEDIATE); |
| 181 | 179 |
| 182 tray_container_ = new TrayContainer(shelf_alignment_); | 180 tray_container_ = new TrayContainer(shelf_alignment_); |
| 183 SetContents(tray_container_); | 181 SetContents(tray_container_); |
| 184 tray_event_filter_.reset(new TrayEventFilter); | 182 tray_event_filter_.reset(new TrayEventFilter); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); | 384 bubble_view->GetWidget()->GetNativeView()->GetRootWindow(); |
| 387 ash::internal::ShelfLayoutManager* shelf = | 385 ash::internal::ShelfLayoutManager* shelf = |
| 388 ShelfLayoutManager::ForLauncher(root_window); | 386 ShelfLayoutManager::ForLauncher(root_window); |
| 389 bubble_view->SetArrowPaintType( | 387 bubble_view->SetArrowPaintType( |
| 390 shelf->IsVisible() ? views::BubbleBorder::PAINT_NORMAL : | 388 shelf->IsVisible() ? views::BubbleBorder::PAINT_NORMAL : |
| 391 views::BubbleBorder::PAINT_TRANSPARENT); | 389 views::BubbleBorder::PAINT_TRANSPARENT); |
| 392 } | 390 } |
| 393 | 391 |
| 394 } // namespace internal | 392 } // namespace internal |
| 395 } // namespace ash | 393 } // namespace ash |
| OLD | NEW |