| 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/common/shelf/wm_shelf.h" | 5 #include "ash/common/shelf/wm_shelf.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | |
| 8 #include "ash/common/shelf/shelf_controller.h" | 7 #include "ash/common/shelf/shelf_controller.h" |
| 9 #include "ash/common/shelf/shelf_delegate.h" | 8 #include "ash/common/shelf/shelf_delegate.h" |
| 10 #include "ash/common/shelf/shelf_item_delegate.h" | 9 #include "ash/common/shelf/shelf_item_delegate.h" |
| 11 #include "ash/common/shelf/shelf_layout_manager.h" | 10 #include "ash/common/shelf/shelf_layout_manager.h" |
| 12 #include "ash/common/shelf/shelf_locking_manager.h" | 11 #include "ash/common/shelf/shelf_locking_manager.h" |
| 13 #include "ash/common/shelf/shelf_model.h" | 12 #include "ash/common/shelf/shelf_model.h" |
| 14 #include "ash/common/shelf/shelf_widget.h" | 13 #include "ash/common/shelf/shelf_widget.h" |
| 15 #include "ash/common/shelf/wm_shelf_observer.h" | 14 #include "ash/common/shelf/wm_shelf_observer.h" |
| 16 #include "ash/common/system/tray/system_tray_delegate.h" | 15 #include "ash/common/system/tray/system_tray_delegate.h" |
| 17 #include "ash/common/wm_lookup.h" | 16 #include "ash/common/wm_lookup.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 : shelf_layout_manager_(shelf_layout_manager) { | 37 : shelf_layout_manager_(shelf_layout_manager) { |
| 39 Shell::GetInstance()->AddPreTargetHandler(this); | 38 Shell::GetInstance()->AddPreTargetHandler(this); |
| 40 } | 39 } |
| 41 ~AutoHideEventHandler() override { | 40 ~AutoHideEventHandler() override { |
| 42 Shell::GetInstance()->RemovePreTargetHandler(this); | 41 Shell::GetInstance()->RemovePreTargetHandler(this); |
| 43 } | 42 } |
| 44 | 43 |
| 45 // Overridden from ui::EventHandler: | 44 // Overridden from ui::EventHandler: |
| 46 void OnMouseEvent(ui::MouseEvent* event) override { | 45 void OnMouseEvent(ui::MouseEvent* event) override { |
| 47 shelf_layout_manager_->UpdateAutoHideForMouseEvent( | 46 shelf_layout_manager_->UpdateAutoHideForMouseEvent( |
| 48 event, WmWindowAura::Get(static_cast<aura::Window*>(event->target()))); | 47 event, WmWindow::Get(static_cast<aura::Window*>(event->target()))); |
| 49 } | 48 } |
| 50 void OnGestureEvent(ui::GestureEvent* event) override { | 49 void OnGestureEvent(ui::GestureEvent* event) override { |
| 51 shelf_layout_manager_->UpdateAutoHideForGestureEvent( | 50 shelf_layout_manager_->UpdateAutoHideForGestureEvent( |
| 52 event, WmWindowAura::Get(static_cast<aura::Window*>(event->target()))); | 51 event, WmWindow::Get(static_cast<aura::Window*>(event->target()))); |
| 53 } | 52 } |
| 54 | 53 |
| 55 private: | 54 private: |
| 56 ShelfLayoutManager* shelf_layout_manager_; | 55 ShelfLayoutManager* shelf_layout_manager_; |
| 57 DISALLOW_COPY_AND_ASSIGN(AutoHideEventHandler); | 56 DISALLOW_COPY_AND_ASSIGN(AutoHideEventHandler); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 // WmShelf --------------------------------------------------------------------- | 59 // WmShelf --------------------------------------------------------------------- |
| 61 | 60 |
| 62 WmShelf::WmShelf() : time_last_auto_hide_change_(base::TimeTicks::Now()) {} | 61 WmShelf::WmShelf() : time_last_auto_hide_change_(base::TimeTicks::Now()) {} |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 387 |
| 389 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, | 388 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, |
| 390 BackgroundAnimatorChangeType change_type) { | 389 BackgroundAnimatorChangeType change_type) { |
| 391 if (background_type == GetBackgroundType()) | 390 if (background_type == GetBackgroundType()) |
| 392 return; | 391 return; |
| 393 for (auto& observer : observers_) | 392 for (auto& observer : observers_) |
| 394 observer.OnBackgroundTypeChanged(background_type, change_type); | 393 observer.OnBackgroundTypeChanged(background_type, change_type); |
| 395 } | 394 } |
| 396 | 395 |
| 397 } // namespace ash | 396 } // namespace ash |
| OLD | NEW |