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

Unified Diff: ash/wm/ash_focus_rules.cc

Issue 2033843003: Makes ash/mus use RootWindowControllerCommon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_mash_wm
Patch Set: merge fail Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/ash_focus_rules.cc
diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc
index 3107e9f84751b2ecffa14fc2743cf00b40d28ebf..5d7dbce567777e404eb8ac212f848a866ff29209 100644
--- a/ash/wm/ash_focus_rules.cc
+++ b/ash/wm/ash_focus_rules.cc
@@ -16,26 +16,6 @@ namespace ash {
namespace wm {
namespace {
-// These are the list of container ids of containers which may contain windows
-// that need to be activated in the order that they should be activated.
-const int kWindowContainerIds[] = {
- kShellWindowId_OverlayContainer,
- kShellWindowId_LockSystemModalContainer,
- kShellWindowId_SettingBubbleContainer,
- kShellWindowId_LockScreenContainer,
- kShellWindowId_SystemModalContainer,
- kShellWindowId_AlwaysOnTopContainer,
- kShellWindowId_AppListContainer,
- kShellWindowId_DefaultContainer,
-
- // Docked, panel, launcher and status are intentionally checked after other
- // containers even though these layers are higher. The user expects their
- // windows to be focused before these elements.
- kShellWindowId_DockedContainer,
- kShellWindowId_PanelContainer,
- kShellWindowId_ShelfContainer,
- kShellWindowId_StatusContainer, };
-
bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window,
int container_id) {
for (; window; window = window->parent()) {
@@ -75,8 +55,8 @@ bool AshFocusRules::SupportsChildActivation(aura::Window* window) const {
if (window->id() == kShellWindowId_DefaultContainer)
return true;
- for (size_t i = 0; i < arraysize(kWindowContainerIds); i++) {
- if (window->id() == kWindowContainerIds[i])
+ for (size_t i = 0; i < kNumActivatableShellWindowIds; i++) {
+ if (window->id() == kActivatableShellWindowIds[i])
return true;
}
return false;
@@ -136,9 +116,10 @@ aura::Window* AshFocusRules::GetNextActivatableWindow(
aura::Window* root = starting_window->GetRootWindow();
if (!root)
root = Shell::GetTargetRootWindow();
- int container_count = static_cast<int>(arraysize(kWindowContainerIds));
+ int container_count = static_cast<int>(kNumActivatableShellWindowIds);
for (int i = 0; i < container_count; i++) {
- aura::Window* container = Shell::GetContainer(root, kWindowContainerIds[i]);
+ aura::Window* container =
+ Shell::GetContainer(root, kActivatableShellWindowIds[i]);
if (container && container->Contains(starting_window)) {
starting_container_index = i;
break;
@@ -164,7 +145,7 @@ aura::Window* AshFocusRules::GetTopmostWindowToActivateForContainerIndex(
aura::Window* window = NULL;
aura::Window* root = ignore ? ignore->GetRootWindow() : NULL;
aura::Window::Windows containers = Shell::GetContainersFromAllRootWindows(
- kWindowContainerIds[index], root);
+ kActivatableShellWindowIds[index], root);
for (aura::Window::Windows::const_iterator iter = containers.begin();
iter != containers.end() && !window; ++iter) {
window = GetTopmostWindowToActivateInContainer((*iter), ignore);
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ui/aura/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698