| 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/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 | 414 |
| 415 void ShelfWidget::DelegateView::SetDimmed(bool value) { | 415 void ShelfWidget::DelegateView::SetDimmed(bool value) { |
| 416 if (value == (dimmer_.get() != NULL)) | 416 if (value == (dimmer_.get() != NULL)) |
| 417 return; | 417 return; |
| 418 | 418 |
| 419 if (value) { | 419 if (value) { |
| 420 dimmer_.reset(new views::Widget); | 420 dimmer_.reset(new views::Widget); |
| 421 views::Widget::InitParams params( | 421 views::Widget::InitParams params( |
| 422 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 422 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 423 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 423 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 424 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; | 424 params.can_activate = false; |
| 425 params.accept_events = false; | 425 params.accept_events = false; |
| 426 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 426 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 427 params.parent = shelf_->GetNativeView(); | 427 params.parent = shelf_->GetNativeView(); |
| 428 dimmer_->Init(params); | 428 dimmer_->Init(params); |
| 429 dimmer_->GetNativeWindow()->SetName("ShelfDimmer"); | 429 dimmer_->GetNativeWindow()->SetName("ShelfDimmer"); |
| 430 dimmer_->SetBounds(shelf_->GetWindowBoundsInScreen()); | 430 dimmer_->SetBounds(shelf_->GetWindowBoundsInScreen()); |
| 431 // The shelf should not take focus when it is initially shown. | 431 // The shelf should not take focus when it is initially shown. |
| 432 dimmer_->set_focus_on_creation(false); | 432 dimmer_->set_focus_on_creation(false); |
| 433 dimmer_view_ = new DimmerView(shelf_, disable_dimming_animations_for_test_); | 433 dimmer_view_ = new DimmerView(shelf_, disable_dimming_animations_for_test_); |
| 434 dimmer_->SetContentsView(dimmer_view_); | 434 dimmer_->SetContentsView(dimmer_view_); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 801 DCHECK(delegate_view_); | 801 DCHECK(delegate_view_); |
| 802 return delegate_view_->disable_dimming_animations_for_test(); | 802 return delegate_view_->disable_dimming_animations_for_test(); |
| 803 } | 803 } |
| 804 | 804 |
| 805 void ShelfWidget::WillDeleteShelf() { | 805 void ShelfWidget::WillDeleteShelf() { |
| 806 shelf_layout_manager_->RemoveObserver(this); | 806 shelf_layout_manager_->RemoveObserver(this); |
| 807 shelf_layout_manager_ = NULL; | 807 shelf_layout_manager_ = NULL; |
| 808 } | 808 } |
| 809 | 809 |
| 810 } // namespace ash | 810 } // namespace ash |
| OLD | NEW |