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/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 window_(window), | 42 window_(window), |
43 root_window_(window->GetRootWindow()), | 43 root_window_(window->GetRootWindow()), |
44 work_area_in_parent_(ScreenUtil::ConvertRectFromScreen( | 44 work_area_in_parent_(ScreenUtil::ConvertRectFromScreen( |
45 window_, | 45 window_, |
46 Shell::GetScreen()->GetDisplayNearestWindow(window_).work_area())), | 46 Shell::GetScreen()->GetDisplayNearestWindow(window_).work_area())), |
47 is_fullscreen_(GetRootWindowController( | 47 is_fullscreen_(GetRootWindowController( |
48 window->GetRootWindow())->GetWindowForFullscreenMode() != NULL) { | 48 window->GetRootWindow())->GetWindowForFullscreenMode() != NULL) { |
49 Shell::GetInstance()->activation_client()->AddObserver(this); | 49 Shell::GetInstance()->activation_client()->AddObserver(this); |
50 Shell::GetInstance()->AddShellObserver(this); | 50 Shell::GetInstance()->AddShellObserver(this); |
51 root_window_->AddObserver(this); | 51 root_window_->AddObserver(this); |
| 52 DCHECK(window->GetProperty(kSnapChildrenToPixelBoundary)); |
52 } | 53 } |
53 | 54 |
54 WorkspaceLayoutManager::~WorkspaceLayoutManager() { | 55 WorkspaceLayoutManager::~WorkspaceLayoutManager() { |
55 if (root_window_) | 56 if (root_window_) |
56 root_window_->RemoveObserver(this); | 57 root_window_->RemoveObserver(this); |
57 for (WindowSet::const_iterator i = windows_.begin(); i != windows_.end(); ++i) | 58 for (WindowSet::const_iterator i = windows_.begin(); i != windows_.end(); ++i) |
58 (*i)->RemoveObserver(this); | 59 (*i)->RemoveObserver(this); |
59 Shell::GetInstance()->RemoveShellObserver(this); | 60 Shell::GetInstance()->RemoveShellObserver(this); |
60 Shell::GetInstance()->activation_client()->RemoveObserver(this); | 61 Shell::GetInstance()->activation_client()->RemoveObserver(this); |
61 } | 62 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 bool is_fullscreen = GetRootWindowController( | 307 bool is_fullscreen = GetRootWindowController( |
307 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL; | 308 window_->GetRootWindow())->GetWindowForFullscreenMode() != NULL; |
308 if (is_fullscreen != is_fullscreen_) { | 309 if (is_fullscreen != is_fullscreen_) { |
309 ash::Shell::GetInstance()->NotifyFullscreenStateChange( | 310 ash::Shell::GetInstance()->NotifyFullscreenStateChange( |
310 is_fullscreen, window_->GetRootWindow()); | 311 is_fullscreen, window_->GetRootWindow()); |
311 is_fullscreen_ = is_fullscreen; | 312 is_fullscreen_ = is_fullscreen; |
312 } | 313 } |
313 } | 314 } |
314 | 315 |
315 } // namespace ash | 316 } // namespace ash |
OLD | NEW |