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/wm/shelf_layout_manager.h" | 5 #include "ash/wm/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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 void ShelfLayoutManager::OnWindowActivated(aura::Window* active, | 488 void ShelfLayoutManager::OnWindowActivated(aura::Window* active, |
489 aura::Window* old_active) { | 489 aura::Window* old_active) { |
490 UpdateAutoHideStateNow(); | 490 UpdateAutoHideStateNow(); |
491 } | 491 } |
492 | 492 |
493 //////////////////////////////////////////////////////////////////////////////// | 493 //////////////////////////////////////////////////////////////////////////////// |
494 // ShelfLayoutManager, private: | 494 // ShelfLayoutManager, private: |
495 | 495 |
496 ShelfLayoutManager::TargetBounds::TargetBounds() : opacity(0.0f) {} | 496 ShelfLayoutManager::TargetBounds::TargetBounds() : opacity(0.0f) {} |
497 | 497 |
498 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( | 498 gfx::Rect ShelfLayoutManager::GetWorkAreaBounds( |
499 aura::Window* window) { | |
500 gfx::Rect bounds(ScreenAsh::GetDisplayBoundsInParent(window)); | |
501 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { | |
502 AdjustBoundsBasedOnAlignment(kAutoHideSize, &bounds); | |
503 return bounds; | |
504 } | |
505 // SHELF_AUTO_HIDE_BEHAVIOR_NEVER maximized windows don't get any taller. | |
506 return GetUnmaximizedWorkAreaBounds(window); | |
507 } | |
508 | |
509 gfx::Rect ShelfLayoutManager::GetUnmaximizedWorkAreaBounds( | |
510 aura::Window* window) { | 499 aura::Window* window) { |
511 gfx::Rect bounds(ScreenAsh::GetDisplayBoundsInParent(window)); | 500 gfx::Rect bounds(ScreenAsh::GetDisplayBoundsInParent(window)); |
512 int size; | 501 int size; |
513 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { | 502 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { |
514 size = kAutoHideSize; | 503 size = kAutoHideSize; |
515 } else { | 504 } else { |
516 int width, height; | 505 int width, height; |
517 GetShelfSize(&width, &height); | 506 GetShelfSize(&width, &height); |
518 size = std::max(width, height); | 507 size = std::max(width, height); |
519 } | 508 } |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { | 909 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { |
921 if (state.visibility_state == VISIBLE) | 910 if (state.visibility_state == VISIBLE) |
922 return size; | 911 return size; |
923 if (state.visibility_state == AUTO_HIDE) | 912 if (state.visibility_state == AUTO_HIDE) |
924 return kAutoHideSize; | 913 return kAutoHideSize; |
925 return 0; | 914 return 0; |
926 } | 915 } |
927 | 916 |
928 } // namespace internal | 917 } // namespace internal |
929 } // namespace ash | 918 } // namespace ash |
OLD | NEW |