| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/aura/wm_shelf_aura.h" | 5 #include "ash/aura/wm_shelf_aura.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
| 9 #include "ash/shelf/dimmer_view.h" | 9 #include "ash/shelf/dimmer_view.h" |
| 10 #include "ash/shelf/shelf_bezel_event_handler.h" | 10 #include "ash/shelf/shelf_bezel_event_handler.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // WmShelfAura ----------------------------------------------------------------- | 44 // WmShelfAura ----------------------------------------------------------------- |
| 45 | 45 |
| 46 WmShelfAura::WmShelfAura() {} | 46 WmShelfAura::WmShelfAura() {} |
| 47 | 47 |
| 48 WmShelfAura::~WmShelfAura() {} | 48 WmShelfAura::~WmShelfAura() {} |
| 49 | 49 |
| 50 WmDimmerView* WmShelfAura::CreateDimmerView(bool disable_animations_for_test) { | 50 WmDimmerView* WmShelfAura::CreateDimmerView(bool disable_animations_for_test) { |
| 51 return DimmerView::Create(this, disable_animations_for_test); | 51 return DimmerView::Create(this, disable_animations_for_test); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void WmShelfAura::SetShelfLayoutManager(ShelfLayoutManager* manager) { | 54 void WmShelfAura::CreateShelfWidget(WmWindow* root) { |
| 55 WmShelf::SetShelfLayoutManager(manager); | 55 WmShelf::CreateShelfWidget(root); |
| 56 bezel_event_handler_.reset(new ShelfBezelEventHandler(this)); | 56 bezel_event_handler_.reset(new ShelfBezelEventHandler(this)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void WmShelfAura::WillDeleteShelfLayoutManager() { | 59 void WmShelfAura::WillDeleteShelfLayoutManager() { |
| 60 // Clear event handlers that might forward events to the destroyed instance. | 60 // Clear event handlers that might forward events to the destroyed instance. |
| 61 auto_hide_event_handler_.reset(); | 61 auto_hide_event_handler_.reset(); |
| 62 bezel_event_handler_.reset(); | 62 bezel_event_handler_.reset(); |
| 63 WmShelf::WillDeleteShelfLayoutManager(); | 63 WmShelf::WillDeleteShelfLayoutManager(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) { | 66 void WmShelfAura::WillChangeVisibilityState(ShelfVisibilityState new_state) { |
| 67 WmShelf::WillChangeVisibilityState(new_state); | 67 WmShelf::WillChangeVisibilityState(new_state); |
| 68 if (new_state != SHELF_AUTO_HIDE) { | 68 if (new_state != SHELF_AUTO_HIDE) { |
| 69 auto_hide_event_handler_.reset(); | 69 auto_hide_event_handler_.reset(); |
| 70 } else if (!auto_hide_event_handler_) { | 70 } else if (!auto_hide_event_handler_) { |
| 71 auto_hide_event_handler_.reset( | 71 auto_hide_event_handler_.reset( |
| 72 new AutoHideEventHandler(shelf_layout_manager())); | 72 new AutoHideEventHandler(shelf_layout_manager())); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace ash | 76 } // namespace ash |
| OLD | NEW |