| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/wm/workspace/maximized_workspace.h" | |
| 6 | |
| 7 #include "ash/screen_ash.h" | |
| 8 #include "ash/wm/property_util.h" | |
| 9 #include "ash/wm/window_util.h" | |
| 10 #include "ash/wm/workspace/workspace_manager.h" | |
| 11 #include "base/logging.h" | |
| 12 #include "ui/aura/client/aura_constants.h" | |
| 13 #include "ui/aura/root_window.h" | |
| 14 #include "ui/aura/window.h" | |
| 15 #include "ui/base/ui_base_types.h" | |
| 16 #include "ui/gfx/screen.h" | |
| 17 | |
| 18 namespace ash { | |
| 19 namespace internal { | |
| 20 | |
| 21 MaximizedWorkspace::MaximizedWorkspace(WorkspaceManager* manager) | |
| 22 : Workspace(manager, TYPE_MAXIMIZED) { | |
| 23 } | |
| 24 | |
| 25 MaximizedWorkspace::~MaximizedWorkspace() { | |
| 26 } | |
| 27 | |
| 28 bool MaximizedWorkspace::CanAdd(aura::Window* window) const { | |
| 29 return is_empty() && (wm::IsWindowFullscreen(window) || | |
| 30 wm::IsWindowMaximized(window)); | |
| 31 } | |
| 32 | |
| 33 void MaximizedWorkspace::OnWindowAddedAfter(aura::Window* window, | |
| 34 aura::Window* after) { | |
| 35 ResetWindowBounds(window); | |
| 36 } | |
| 37 | |
| 38 void MaximizedWorkspace::OnWindowRemoved(aura::Window* window) { | |
| 39 } | |
| 40 | |
| 41 void MaximizedWorkspace::ResetWindowBounds(aura::Window* window) { | |
| 42 if (wm::IsWindowFullscreen(window)) { | |
| 43 SetWindowBounds(window, | |
| 44 ScreenAsh::GetDisplayBoundsInParent(window)); | |
| 45 } else { | |
| 46 SetWindowBounds(window, | |
| 47 ScreenAsh::GetMaximizedWindowBoundsInParent(window)); | |
| 48 } | |
| 49 } | |
| 50 | |
| 51 } // namespace internal | |
| 52 } // namespace ash | |
| OLD | NEW |