OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/animation/animation_change_type.h" | 7 #include "ash/animation/animation_change_type.h" |
8 #include "ash/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
9 #include "ash/public/cpp/window_properties.h" | 9 #include "ash/public/cpp/window_properties.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 }; | 77 }; |
78 | 78 |
79 ShelfWidget::DelegateView::DelegateView(ShelfWidget* shelf_widget) | 79 ShelfWidget::DelegateView::DelegateView(ShelfWidget* shelf_widget) |
80 : shelf_widget_(shelf_widget), | 80 : shelf_widget_(shelf_widget), |
81 focus_cycler_(nullptr), | 81 focus_cycler_(nullptr), |
82 opaque_background_(ui::LAYER_SOLID_COLOR), | 82 opaque_background_(ui::LAYER_SOLID_COLOR), |
83 opaque_foreground_(ui::LAYER_SOLID_COLOR) { | 83 opaque_foreground_(ui::LAYER_SOLID_COLOR) { |
84 DCHECK(shelf_widget_); | 84 DCHECK(shelf_widget_); |
85 SetLayoutManager(new views::FillLayout()); | 85 SetLayoutManager(new views::FillLayout()); |
86 set_allow_deactivate_on_esc(true); | 86 set_allow_deactivate_on_esc(true); |
87 opaque_background_.SetColor(SK_ColorBLACK); | |
88 opaque_background_.SetBounds(GetLocalBounds()); | 87 opaque_background_.SetBounds(GetLocalBounds()); |
89 opaque_foreground_.SetColor(SK_ColorBLACK); | |
90 opaque_foreground_.SetBounds(GetLocalBounds()); | 88 opaque_foreground_.SetBounds(GetLocalBounds()); |
91 opaque_foreground_.SetOpacity(0.0f); | 89 opaque_foreground_.SetOpacity(0.0f); |
92 } | 90 } |
93 | 91 |
94 ShelfWidget::DelegateView::~DelegateView() {} | 92 ShelfWidget::DelegateView::~DelegateView() {} |
95 | 93 |
96 void ShelfWidget::DelegateView::SetParentLayer(ui::Layer* layer) { | 94 void ShelfWidget::DelegateView::SetParentLayer(ui::Layer* layer) { |
97 layer->Add(&opaque_background_); | 95 layer->Add(&opaque_background_); |
98 layer->Add(&opaque_foreground_); | 96 layer->Add(&opaque_foreground_); |
99 ReorderLayers(); | 97 ReorderLayers(); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 if (shelf_view_) | 344 if (shelf_view_) |
347 shelf_view_->UpdateShelfItemBackground(color); | 345 shelf_view_->UpdateShelfItemBackground(color); |
348 } | 346 } |
349 | 347 |
350 void ShelfWidget::WillDeleteShelfLayoutManager() { | 348 void ShelfWidget::WillDeleteShelfLayoutManager() { |
351 shelf_layout_manager_->RemoveObserver(this); | 349 shelf_layout_manager_->RemoveObserver(this); |
352 shelf_layout_manager_ = nullptr; | 350 shelf_layout_manager_ = nullptr; |
353 } | 351 } |
354 | 352 |
355 } // namespace ash | 353 } // namespace ash |
OLD | NEW |