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

Side by Side Diff: ash/wm/window_util.cc

Issue 23431009: Windows docking should get triggered by pressing against the screen edge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Windows docking by pressing against the screen edge (rebase) Created 7 years, 3 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/wm/dock/docked_window_resizer_unittest.cc ('k') | ash/wm/workspace/snap_sizer.h » ('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/window_util.h" 5 #include "ash/wm/window_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return true; 70 return true;
71 } 71 }
72 72
73 bool CanResizeWindow(const aura::Window* window) { 73 bool CanResizeWindow(const aura::Window* window) {
74 return window->GetProperty(aura::client::kCanResizeKey); 74 return window->GetProperty(aura::client::kCanResizeKey);
75 } 75 }
76 76
77 bool CanSnapWindow(aura::Window* window) { 77 bool CanSnapWindow(aura::Window* window) {
78 if (!CanResizeWindow(window)) 78 if (!CanResizeWindow(window))
79 return false; 79 return false;
80 if (window->type() == aura::client::WINDOW_TYPE_PANEL)
81 return false;
80 // If a window has a maximum size defined, snapping may make it too big. 82 // If a window has a maximum size defined, snapping may make it too big.
81 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() : 83 return window->delegate() ? window->delegate()->GetMaximumSize().IsEmpty() :
82 true; 84 true;
83 } 85 }
84 86
85 bool IsWindowNormal(const aura::Window* window) { 87 bool IsWindowNormal(const aura::Window* window) {
86 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey)); 88 return IsWindowStateNormal(window->GetProperty(aura::client::kShowStateKey));
87 } 89 }
88 90
89 bool IsWindowStateNormal(ui::WindowShowState state) { 91 bool IsWindowStateNormal(ui::WindowShowState state) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 return false; 186 return false;
185 aura::Window* window_container = 187 aura::Window* window_container =
186 ash::Shell::GetContainer(target_root, window->parent()->id()); 188 ash::Shell::GetContainer(target_root, window->parent()->id());
187 // Move the window to the target launcher. 189 // Move the window to the target launcher.
188 window_container->AddChild(window); 190 window_container->AddChild(window);
189 return true; 191 return true;
190 } 192 }
191 193
192 } // namespace wm 194 } // namespace wm
193 } // namespace ash 195 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_resizer_unittest.cc ('k') | ash/wm/workspace/snap_sizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698