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

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

Issue 13896026: Stick windows to sides of workspaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dock with zero width (rebase) Created 7 years, 6 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/activation_controller.cc ('k') | ash/wm/default_window_resizer.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/ash_focus_rules.h" 5 #include "ash/wm/ash_focus_rules.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 11
12 namespace ash { 12 namespace ash {
13 namespace wm { 13 namespace wm {
14 namespace { 14 namespace {
15 15
16 // These are the list of container ids of containers which may contain windows 16 // These are the list of container ids of containers which may contain windows
17 // that need to be activated in the order that they should be activated. 17 // that need to be activated in the order that they should be activated.
18 const int kWindowContainerIds[] = { 18 const int kWindowContainerIds[] = {
19 internal::kShellWindowId_LockSystemModalContainer, 19 internal::kShellWindowId_LockSystemModalContainer,
20 internal::kShellWindowId_SettingBubbleContainer, 20 internal::kShellWindowId_SettingBubbleContainer,
21 internal::kShellWindowId_LockScreenContainer, 21 internal::kShellWindowId_LockScreenContainer,
22 internal::kShellWindowId_SystemModalContainer, 22 internal::kShellWindowId_SystemModalContainer,
23 internal::kShellWindowId_AlwaysOnTopContainer, 23 internal::kShellWindowId_AlwaysOnTopContainer,
24 internal::kShellWindowId_AppListContainer, 24 internal::kShellWindowId_AppListContainer,
25 internal::kShellWindowId_DefaultContainer, 25 internal::kShellWindowId_DefaultContainer,
26 26
27 // Panel, launcher and status are intentionally checked after other 27 // Docked, panel, launcher and status are intentionally checked after other
28 // containers even though these layers are higher. The user expects their 28 // containers even though these layers are higher. The user expects their
29 // windows to be focused before these elements. 29 // windows to be focused before these elements.
30 internal::kShellWindowId_DockedContainer,
30 internal::kShellWindowId_PanelContainer, 31 internal::kShellWindowId_PanelContainer,
31 internal::kShellWindowId_ShelfContainer, 32 internal::kShellWindowId_ShelfContainer,
32 internal::kShellWindowId_StatusContainer, 33 internal::kShellWindowId_StatusContainer,
33 }; 34 };
34 35
35 bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window, 36 bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window,
36 int container_id) { 37 int container_id) {
37 for (; window; window = window->parent()) { 38 for (; window; window = window->parent()) {
38 if (window->id() >= container_id) 39 if (window->id() >= container_id)
39 return true; 40 return true;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 i != container->children().rend(); 172 i != container->children().rend();
172 ++i) { 173 ++i) {
173 if (*i != ignore && CanActivateWindow(*i) && !wm::IsWindowMinimized(*i)) 174 if (*i != ignore && CanActivateWindow(*i) && !wm::IsWindowMinimized(*i))
174 return *i; 175 return *i;
175 } 176 }
176 return NULL; 177 return NULL;
177 } 178 }
178 179
179 } // namespace wm 180 } // namespace wm
180 } // namespace ash 181 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/activation_controller.cc ('k') | ash/wm/default_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698