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

Side by Side Diff: ash/common/wm/window_positioning_utils.cc

Issue 2162193003: Separates out accelerators using non-common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@accelerators
Patch Set: sim=20 Created 4 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
« no previous file with comments | « ash/common/wm/window_positioning_utils.h ('k') | ash/display/display_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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/wm/window_positioning_utils.h" 5 #include "ash/common/wm/window_positioning_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/wm/window_state.h"
10 #include "ash/common/wm/wm_event.h"
9 #include "ash/common/wm/wm_screen_util.h" 11 #include "ash/common/wm/wm_screen_util.h"
10 #include "ash/common/wm_window.h" 12 #include "ash/common/wm_window.h"
11 #include "ui/gfx/geometry/rect.h" 13 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
13 15
14 namespace ash { 16 namespace ash {
15 namespace wm { 17 namespace wm {
16 18
17 namespace { 19 namespace {
18 20
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 work_area_in_parent.height()); 72 work_area_in_parent.height());
71 } 73 }
72 74
73 gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(WmWindow* window) { 75 gfx::Rect GetDefaultRightSnappedWindowBoundsInParent(WmWindow* window) {
74 gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window)); 76 gfx::Rect work_area_in_parent(GetDisplayWorkAreaBoundsInParent(window));
75 int width = GetDefaultSnappedWindowWidth(window); 77 int width = GetDefaultSnappedWindowWidth(window);
76 return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(), 78 return gfx::Rect(work_area_in_parent.right() - width, work_area_in_parent.y(),
77 width, work_area_in_parent.height()); 79 width, work_area_in_parent.height());
78 } 80 }
79 81
82 void CenterWindow(WmWindow* window) {
83 WMEvent event(WM_EVENT_CENTER);
84 window->GetWindowState()->OnWMEvent(&event);
85 }
86
80 } // namespace wm 87 } // namespace wm
81 } // namespace ash 88 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm/window_positioning_utils.h ('k') | ash/display/display_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698