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/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" |
11 #include "ash/shelf/shelf_constants.h" | 11 #include "ash/shelf/shelf_constants.h" |
12 #include "ash/shelf/shelf_delegate.h" | 12 #include "ash/shelf/shelf_delegate.h" |
13 #include "ash/shelf/shelf_layout_manager.h" | 13 #include "ash/shelf/shelf_layout_manager.h" |
14 #include "ash/shelf/shelf_model.h" | 14 #include "ash/shelf/shelf_model.h" |
15 #include "ash/shelf/shelf_navigator.h" | 15 #include "ash/shelf/shelf_navigator.h" |
16 #include "ash/shelf/shelf_util.h" | 16 #include "ash/shelf/shelf_util.h" |
17 #include "ash/shelf/shelf_view.h" | 17 #include "ash/shelf/shelf_view.h" |
18 #include "ash/shelf/shelf_widget.h" | 18 #include "ash/shelf/shelf_widget.h" |
19 #include "ash/shell.h" | 19 #include "ash/shell.h" |
20 #include "ash/shell_window_ids.h" | 20 #include "ash/shell_window_ids.h" |
21 #include "ash/system/tray/system_tray_delegate.h" | 21 #include "ash/system/tray/system_tray_delegate.h" |
22 #include "ash/wm/common/shelf/wm_shelf_constants.h" | 22 #include "ash/wm/common/shelf/wm_shelf_constants.h" |
23 #include "ash/wm/common/shelf/wm_shelf_util.h" | 23 #include "ash/wm/common/shelf/wm_shelf_util.h" |
24 #include "ash/wm/status_area_layout_manager.h" | 24 #include "ash/wm/status_area_layout_manager.h" |
25 #include "ash/wm/window_properties.h" | 25 #include "ash/wm/window_properties.h" |
26 #include "ash/wm/workspace_controller.h" | 26 #include "ash/wm/workspace_controller.h" |
27 #include "grit/ash_resources.h" | 27 #include "grit/ash_resources.h" |
28 #include "grit/ash_wm_common_resources.h" | |
28 #include "ui/aura/window.h" | 29 #include "ui/aura/window.h" |
29 #include "ui/aura/window_event_dispatcher.h" | 30 #include "ui/aura/window_event_dispatcher.h" |
30 #include "ui/aura/window_observer.h" | 31 #include "ui/aura/window_observer.h" |
31 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
32 #include "ui/compositor/layer.h" | 33 #include "ui/compositor/layer.h" |
33 #include "ui/compositor/scoped_layer_animation_settings.h" | 34 #include "ui/compositor/scoped_layer_animation_settings.h" |
34 #include "ui/events/event_constants.h" | 35 #include "ui/events/event_constants.h" |
35 #include "ui/gfx/canvas.h" | 36 #include "ui/gfx/canvas.h" |
36 #include "ui/gfx/image/image.h" | 37 #include "ui/gfx/image/image.h" |
37 #include "ui/gfx/image/image_skia_operations.h" | 38 #include "ui/gfx/image/image_skia_operations.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
444 | 445 |
445 void ShelfWidget::DelegateView::SetParentLayer(ui::Layer* layer) { | 446 void ShelfWidget::DelegateView::SetParentLayer(ui::Layer* layer) { |
446 layer->Add(&opaque_background_); | 447 layer->Add(&opaque_background_); |
447 layer->Add(&opaque_foreground_); | 448 layer->Add(&opaque_foreground_); |
448 ReorderLayers(); | 449 ReorderLayers(); |
449 } | 450 } |
450 | 451 |
451 void ShelfWidget::DelegateView::OnPaintBackground(gfx::Canvas* canvas) { | 452 void ShelfWidget::DelegateView::OnPaintBackground(gfx::Canvas* canvas) { |
452 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 453 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
453 gfx::ImageSkia shelf_background = | 454 gfx::ImageSkia shelf_background = |
454 *rb->GetImageSkiaNamed(IDR_ASH_SHELF_BACKGROUND); | 455 *rb->GetImageSkiaNamed(IDR_ASH_WM_COMMON_SHELF_BACKGROUND); |
oshima
2016/05/19 22:48:55
It sounds a bit weird to have "shelf_background" i
sky
2016/05/19 22:56:59
DockedWindowLayoutManager uses it: https://coderev
| |
455 const bool horizontal = wm::IsHorizontalAlignment(shelf_->GetAlignment()); | 456 const bool horizontal = wm::IsHorizontalAlignment(shelf_->GetAlignment()); |
456 if (!horizontal) { | 457 if (!horizontal) { |
457 shelf_background = gfx::ImageSkiaOperations::CreateRotatedImage( | 458 shelf_background = gfx::ImageSkiaOperations::CreateRotatedImage( |
458 shelf_background, shelf_->GetAlignment() == wm::SHELF_ALIGNMENT_LEFT | 459 shelf_background, shelf_->GetAlignment() == wm::SHELF_ALIGNMENT_LEFT |
459 ? SkBitmapOperations::ROTATION_90_CW | 460 ? SkBitmapOperations::ROTATION_90_CW |
460 : SkBitmapOperations::ROTATION_270_CW); | 461 : SkBitmapOperations::ROTATION_270_CW); |
461 } | 462 } |
462 const gfx::Rect dock_bounds(shelf_->shelf_layout_manager()->dock_bounds()); | 463 const gfx::Rect dock_bounds(shelf_->shelf_layout_manager()->dock_bounds()); |
463 SkPaint paint; | 464 SkPaint paint; |
464 paint.setAlpha(alpha_); | 465 paint.setAlpha(alpha_); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
787 DCHECK(delegate_view_); | 788 DCHECK(delegate_view_); |
788 return delegate_view_->disable_dimming_animations_for_test(); | 789 return delegate_view_->disable_dimming_animations_for_test(); |
789 } | 790 } |
790 | 791 |
791 void ShelfWidget::WillDeleteShelf() { | 792 void ShelfWidget::WillDeleteShelf() { |
792 shelf_layout_manager_->RemoveObserver(this); | 793 shelf_layout_manager_->RemoveObserver(this); |
793 shelf_layout_manager_ = NULL; | 794 shelf_layout_manager_ = NULL; |
794 } | 795 } |
795 | 796 |
796 } // namespace ash | 797 } // namespace ash |
OLD | NEW |