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

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 should get triggered by pressing against the screen edge (warn) 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
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return false; 204 return false;
203 aura::Window* window_container = 205 aura::Window* window_container =
204 ash::Shell::GetContainer(target_root, window->parent()->id()); 206 ash::Shell::GetContainer(target_root, window->parent()->id());
205 // Move the window to the target launcher. 207 // Move the window to the target launcher.
206 window_container->AddChild(window); 208 window_container->AddChild(window);
207 return true; 209 return true;
208 } 210 }
209 211
210 } // namespace wm 212 } // namespace wm
211 } // namespace ash 213 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698