| 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/wm_shelf_observer.h" | 8 #include "ash/common/shelf/wm_shelf_observer.h" |
| 9 #include "ash/common/wm_window.h" | 9 #include "ash/common/wm_window.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 void WmShelfAura::UpdateIconPositionForWindow(WmWindow* window) { | 127 void WmShelfAura::UpdateIconPositionForWindow(WmWindow* window) { |
| 128 shelf_->UpdateIconPositionForWindow(WmWindowAura::GetAuraWindow(window)); | 128 shelf_->UpdateIconPositionForWindow(WmWindowAura::GetAuraWindow(window)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 gfx::Rect WmShelfAura::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { | 131 gfx::Rect WmShelfAura::GetScreenBoundsOfItemIconForWindow(WmWindow* window) { |
| 132 return shelf_->GetScreenBoundsOfItemIconForWindow( | 132 return shelf_->GetScreenBoundsOfItemIconForWindow( |
| 133 WmWindowAura::GetAuraWindow(window)); | 133 WmWindowAura::GetAuraWindow(window)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool WmShelfAura::ProcessGestureEvent(const ui::GestureEvent& event, | 136 bool WmShelfAura::ProcessGestureEvent(const ui::GestureEvent& event) { |
| 137 WmWindow* target_window) { | 137 // Can be called at login screen. |
| 138 return gesture_handler_.ProcessGestureEvent( | 138 if (!shelf_layout_manager_) |
| 139 event, WmWindowAura::GetAuraWindow(target_window)); | 139 return false; |
| 140 return shelf_layout_manager_->ProcessGestureEvent(event); |
| 140 } | 141 } |
| 141 | 142 |
| 142 void WmShelfAura::UpdateAutoHideForMouseEvent(ui::MouseEvent* event) { | 143 void WmShelfAura::UpdateAutoHideForMouseEvent(ui::MouseEvent* event) { |
| 143 // Auto-hide support for ash_sysui. | 144 // Auto-hide support for ash_sysui. |
| 144 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) | 145 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) |
| 145 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); | 146 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); |
| 146 } | 147 } |
| 147 | 148 |
| 148 void WmShelfAura::UpdateAutoHideForGestureEvent(ui::GestureEvent* event) { | 149 void WmShelfAura::UpdateAutoHideForGestureEvent(ui::GestureEvent* event) { |
| 149 // Auto-hide support for ash_sysui. | 150 // Auto-hide support for ash_sysui. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 void WmShelfAura::OnAutoHideStateChanged(ShelfAutoHideState new_state) { | 193 void WmShelfAura::OnAutoHideStateChanged(ShelfAutoHideState new_state) { |
| 193 FOR_EACH_OBSERVER(WmShelfObserver, observers_, | 194 FOR_EACH_OBSERVER(WmShelfObserver, observers_, |
| 194 OnAutoHideStateChanged(new_state)); | 195 OnAutoHideStateChanged(new_state)); |
| 195 } | 196 } |
| 196 | 197 |
| 197 void WmShelfAura::OnShelfIconPositionsChanged() { | 198 void WmShelfAura::OnShelfIconPositionsChanged() { |
| 198 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); | 199 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); |
| 199 } | 200 } |
| 200 | 201 |
| 201 } // namespace ash | 202 } // namespace ash |
| OLD | NEW |