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 19 matching lines...) Expand all Loading... | |
30 #include "ui/events/event.h" | 30 #include "ui/events/event.h" |
31 #include "ui/gfx/screen.h" | 31 #include "ui/gfx/screen.h" |
32 #include "ui/keyboard/keyboard_controller_observer.h" | 32 #include "ui/keyboard/keyboard_controller_observer.h" |
33 #include "ui/wm/core/window_util.h" | 33 #include "ui/wm/core/window_util.h" |
34 #include "ui/wm/public/activation_client.h" | 34 #include "ui/wm/public/activation_client.h" |
35 | 35 |
36 using aura::Window; | 36 using aura::Window; |
37 | 37 |
38 namespace ash { | 38 namespace ash { |
39 | 39 |
40 WorkspaceLayoutManager::WorkspaceLayoutManager(aura::Window* window) | 40 WorkspaceLayoutManager::WorkspaceLayoutManager(aura::Window* window) |
Jun Mukai
2014/07/16 22:59:08
Why isn't WorkspaceLayoutManager a subclass of Sna
oshima
2014/07/17 22:07:56
because this class has its own logic to adjust off
Jun Mukai
2014/07/17 22:26:31
Acknowledged.
| |
41 : shelf_(NULL), | 41 : shelf_(NULL), |
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 window->SetProperty(kSnapChildrenToPixelBoundary, true); | |
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 |