| 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 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 531 |
| 532 if (state_.Equals(state)) | 532 if (state_.Equals(state)) |
| 533 return; // Nothing changed. | 533 return; // Nothing changed. |
| 534 | 534 |
| 535 FOR_EACH_OBSERVER(Observer, observers_, | 535 FOR_EACH_OBSERVER(Observer, observers_, |
| 536 WillChangeVisibilityState(visibility_state)); | 536 WillChangeVisibilityState(visibility_state)); |
| 537 | 537 |
| 538 if (state.visibility_state == SHELF_AUTO_HIDE) { | 538 if (state.visibility_state == SHELF_AUTO_HIDE) { |
| 539 // When state is SHELF_AUTO_HIDE we need to track when the mouse is over the | 539 // When state is SHELF_AUTO_HIDE we need to track when the mouse is over the |
| 540 // launcher to unhide the shelf. AutoHideEventFilter does that for us. | 540 // launcher to unhide the shelf. AutoHideEventFilter does that for us. |
| 541 if (!event_filter_.get()) | 541 if (!event_filter_) |
| 542 event_filter_.reset(new AutoHideEventFilter(this)); | 542 event_filter_.reset(new AutoHideEventFilter(this)); |
| 543 } else { | 543 } else { |
| 544 event_filter_.reset(NULL); | 544 event_filter_.reset(NULL); |
| 545 } | 545 } |
| 546 | 546 |
| 547 auto_hide_timer_.Stop(); | 547 auto_hide_timer_.Stop(); |
| 548 | 548 |
| 549 // Animating the background when transitioning from auto-hide & hidden to | 549 // Animating the background when transitioning from auto-hide & hidden to |
| 550 // visible is janky. Update the background immediately in this case. | 550 // visible is janky. Update the background immediately in this case. |
| 551 BackgroundAnimator::ChangeType change_type = | 551 BackgroundAnimator::ChangeType change_type = |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 907 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
| 908 if (state.visibility_state == SHELF_VISIBLE) | 908 if (state.visibility_state == SHELF_VISIBLE) |
| 909 return size; | 909 return size; |
| 910 if (state.visibility_state == SHELF_AUTO_HIDE) | 910 if (state.visibility_state == SHELF_AUTO_HIDE) |
| 911 return kAutoHideSize; | 911 return kAutoHideSize; |
| 912 return 0; | 912 return 0; |
| 913 } | 913 } |
| 914 | 914 |
| 915 } // namespace internal | 915 } // namespace internal |
| 916 } // namespace ash | 916 } // namespace ash |
| OLD | NEW |