| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 "window_manager/screen_locker_handler.h" | 5 #include "window_manager/screen_locker_handler.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <tr1/unordered_set> | 8 #include <tr1/unordered_set> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void ScreenLockerHandler::HandleScreenResize() { | 94 void ScreenLockerHandler::HandleScreenResize() { |
| 95 for (set<XWindow>::const_iterator it = screen_locker_xids_.begin(); | 95 for (set<XWindow>::const_iterator it = screen_locker_xids_.begin(); |
| 96 it != screen_locker_xids_.end(); ++it) { | 96 it != screen_locker_xids_.end(); ++it) { |
| 97 Window* win = wm_->GetWindowOrDie(*it); | 97 Window* win = wm_->GetWindowOrDie(*it); |
| 98 // TODO: The override-redirect check can be removed once Chrome is | 98 // TODO: The override-redirect check can be removed once Chrome is |
| 99 // using regular windows for the screen locker. | 99 // using regular windows for the screen locker. |
| 100 if (!win->override_redirect()) | 100 if (!win->override_redirect()) |
| 101 win->ResizeClient(wm_->width(), wm_->height(), GRAVITY_NORTHWEST); | 101 win->Resize(wm_->root_size(), GRAVITY_NORTHWEST); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 bool ScreenLockerHandler::HandleWindowMapRequest(Window* win) { | 105 bool ScreenLockerHandler::HandleWindowMapRequest(Window* win) { |
| 106 DCHECK(win); | 106 DCHECK(win); |
| 107 if (win->type() != chromeos::WM_IPC_WINDOW_CHROME_SCREEN_LOCKER) | 107 if (win->type() != chromeos::WM_IPC_WINDOW_CHROME_SCREEN_LOCKER) |
| 108 return false; | 108 return false; |
| 109 | 109 |
| 110 win->SetVisibility(Window::VISIBILITY_SHOWN); | 110 win->SetVisibility(Window::VISIBILITY_SHOWN); |
| 111 win->Move(Point(0, 0), 0); | 111 win->Move(Point(0, 0), 0); |
| 112 win->ResizeClient(wm_->width(), wm_->height(), GRAVITY_NORTHWEST); | 112 win->Resize(wm_->root_size(), GRAVITY_NORTHWEST); |
| 113 wm_->stacking_manager()->StackWindowAtTopOfLayer( | 113 wm_->stacking_manager()->StackWindowAtTopOfLayer( |
| 114 win, | 114 win, |
| 115 StackingManager::LAYER_SCREEN_LOCKER, | 115 StackingManager::LAYER_SCREEN_LOCKER, |
| 116 StackingManager::SHADOW_DIRECTLY_BELOW_ACTOR); | 116 StackingManager::SHADOW_DIRECTLY_BELOW_ACTOR); |
| 117 return true; | 117 return true; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void ScreenLockerHandler::HandleWindowMap(Window* win) { | 120 void ScreenLockerHandler::HandleWindowMap(Window* win) { |
| 121 DCHECK(win); | 121 DCHECK(win); |
| 122 // If we see an override-redirect info bubble that's asking to be displayed | 122 // If we see an override-redirect info bubble that's asking to be displayed |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 wm_->compositor()->ResetActiveVisibilityGroups(); | 482 wm_->compositor()->ResetActiveVisibilityGroups(); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 void ScreenLockerHandler::HandleDestroySnapshotTimeout() { | 486 void ScreenLockerHandler::HandleDestroySnapshotTimeout() { |
| 487 destroy_snapshot_timeout_id_ = -1; | 487 destroy_snapshot_timeout_id_ = -1; |
| 488 DestroySnapshotAndUpdateVisibilityGroup(); | 488 DestroySnapshotAndUpdateVisibilityGroup(); |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace window_manager | 491 } // namespace window_manager |
| OLD | NEW |