Chromium Code Reviews| 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/workspace_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_layout_manager.h" | 7 #include "ash/shelf/shelf_layout_manager.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/base_layout_manager.h" | 10 #include "ash/wm/base_layout_manager.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 wm::WindowState* window_state = wm::GetWindowState(*i); | 67 wm::WindowState* window_state = wm::GetWindowState(*i); |
| 68 if (window_state->ignored_by_shelf()) | 68 if (window_state->ignored_by_shelf()) |
| 69 continue; | 69 continue; |
| 70 ui::Layer* layer = (*i)->layer(); | 70 ui::Layer* layer = (*i)->layer(); |
| 71 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f) | 71 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f) |
| 72 continue; | 72 continue; |
| 73 if (window_state->IsMaximized()) { | 73 if (window_state->IsMaximized()) { |
| 74 // An untracked window may still be fullscreen so we keep iterating when | 74 // An untracked window may still be fullscreen so we keep iterating when |
| 75 // we hit a maximized window. | 75 // we hit a maximized window. |
| 76 has_maximized_window = true; | 76 has_maximized_window = true; |
| 77 } else if (window_state->IsFullscreen()) { | 77 } else if (*i == windows.back() && window_state->IsFullscreen()) { |
|
flackr
2013/12/03 22:05:55
Hang on, this check for topmost doesn't seem to be
| |
| 78 // Only enter the full screen state if the topmost window is fullscreen. | |
| 78 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 79 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
| 79 } | 80 } |
| 80 if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds)) | 81 if (!window_overlaps_launcher && (*i)->bounds().Intersects(shelf_bounds)) |
| 81 window_overlaps_launcher = true; | 82 window_overlaps_launcher = true; |
| 82 } | 83 } |
| 83 if (has_maximized_window) | 84 if (has_maximized_window) |
| 84 return WORKSPACE_WINDOW_STATE_MAXIMIZED; | 85 return WORKSPACE_WINDOW_STATE_MAXIMIZED; |
| 85 | 86 |
| 86 return window_overlaps_launcher ? | 87 return window_overlaps_launcher ? |
| 87 WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF : | 88 WORKSPACE_WINDOW_STATE_WINDOW_OVERLAPS_SHELF : |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 119 settings.SetTweenType(gfx::Tween::EASE_OUT); | 120 settings.SetTweenType(gfx::Tween::EASE_OUT); |
| 120 settings.SetTransitionDuration( | 121 settings.SetTransitionDuration( |
| 121 base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); | 122 base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); |
| 122 viewport_->layer()->SetTransform(gfx::Transform()); | 123 viewport_->layer()->SetTransform(gfx::Transform()); |
| 123 viewport_->layer()->SetOpacity(1.0f); | 124 viewport_->layer()->SetOpacity(1.0f); |
| 124 } | 125 } |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace internal | 128 } // namespace internal |
| 128 } // namespace ash | 129 } // namespace ash |
| OLD | NEW |