OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 duration_override_in_ms_ = duration_override_in_ms; | 382 duration_override_in_ms_ = duration_override_in_ms; |
383 } | 383 } |
384 | 384 |
385 //////////////////////////////////////////////////////////////////////////////// | 385 //////////////////////////////////////////////////////////////////////////////// |
386 // ShelfLayoutManager, wm::WmSnapToPixelLayoutManager implementation: | 386 // ShelfLayoutManager, wm::WmSnapToPixelLayoutManager implementation: |
387 | 387 |
388 void ShelfLayoutManager::OnWindowResized() { | 388 void ShelfLayoutManager::OnWindowResized() { |
389 LayoutShelf(); | 389 LayoutShelf(); |
390 } | 390 } |
391 | 391 |
392 void ShelfLayoutManager::SetChildBounds(WmWindow* child, | 392 void ShelfLayoutManager::SetChildBounds(aura::Window* child, |
393 const gfx::Rect& requested_bounds) { | 393 const gfx::Rect& requested_bounds) { |
394 wm::WmSnapToPixelLayoutManager::SetChildBounds(child, requested_bounds); | 394 wm::WmSnapToPixelLayoutManager::SetChildBounds(child, requested_bounds); |
395 // We may contain other widgets (such as frame maximize bubble) but they don't | 395 // We may contain other widgets (such as frame maximize bubble) but they don't |
396 // effect the layout in anyway. | 396 // effect the layout in anyway. |
397 if (!updating_bounds_ && | 397 if (!updating_bounds_ && |
398 ((WmWindow::Get(shelf_widget_->GetNativeWindow()) == child) || | 398 ((shelf_widget_->GetNativeWindow() == child) || |
399 (WmWindow::Get(shelf_widget_->status_area_widget()->GetNativeWindow()) == | 399 (shelf_widget_->status_area_widget()->GetNativeWindow() == child))) { |
400 child))) { | |
401 LayoutShelf(); | 400 LayoutShelf(); |
402 } | 401 } |
403 } | 402 } |
404 | 403 |
405 void ShelfLayoutManager::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) { | 404 void ShelfLayoutManager::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) { |
406 UpdateVisibilityState(); | 405 UpdateVisibilityState(); |
407 } | 406 } |
408 | 407 |
409 void ShelfLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) { | 408 void ShelfLayoutManager::OnPinnedStateChanged(WmWindow* pinned_window) { |
410 // Shelf needs to be hidden on entering to pinned mode, or restored | 409 // Shelf needs to be hidden on entering to pinned mode, or restored |
411 // on exiting from pinned mode. | 410 // on exiting from pinned mode. |
412 UpdateVisibilityState(); | 411 UpdateVisibilityState(); |
413 } | 412 } |
414 | 413 |
415 void ShelfLayoutManager::OnVirtualKeyboardStateChanged(bool activated, | 414 void ShelfLayoutManager::OnVirtualKeyboardStateChanged( |
416 WmWindow* root_window) { | 415 bool activated, |
| 416 aura::Window* root_window) { |
417 UpdateKeyboardObserverFromStateChanged( | 417 UpdateKeyboardObserverFromStateChanged( |
418 activated, root_window, | 418 activated, root_window, shelf_widget_->GetNativeWindow()->GetRootWindow(), |
419 WmWindow::Get(shelf_widget_->GetNativeWindow())->GetRootWindow(), | |
420 &keyboard_observer_); | 419 &keyboard_observer_); |
421 } | 420 } |
422 | 421 |
423 void ShelfLayoutManager::OnWindowActivated(ActivationReason reason, | 422 void ShelfLayoutManager::OnWindowActivated(ActivationReason reason, |
424 aura::Window* gained_active, | 423 aura::Window* gained_active, |
425 aura::Window* lost_active) { | 424 aura::Window* lost_active) { |
426 UpdateAutoHideStateNow(); | 425 UpdateAutoHideStateNow(); |
427 } | 426 } |
428 | 427 |
429 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { | 428 void ShelfLayoutManager::OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) { |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1142 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1141 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1143 } | 1142 } |
1144 | 1143 |
1145 void ShelfLayoutManager::CancelGestureDrag() { | 1144 void ShelfLayoutManager::CancelGestureDrag() { |
1146 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; | 1145 gesture_drag_status_ = GESTURE_DRAG_CANCEL_IN_PROGRESS; |
1147 UpdateVisibilityState(); | 1146 UpdateVisibilityState(); |
1148 gesture_drag_status_ = GESTURE_DRAG_NONE; | 1147 gesture_drag_status_ = GESTURE_DRAG_NONE; |
1149 } | 1148 } |
1150 | 1149 |
1151 } // namespace ash | 1150 } // namespace ash |
OLD | NEW |