Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: ash/wm/workspace/workspace_layout_manager.cc

Issue 357063002: Snap widgets to pixel boundary on ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adjust tests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_util.cc ('k') | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698