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

Unified Diff: ash/common/wm/focus_rules.cc

Issue 2736573002: chromeos: Move files in //ash/common to //ash, part 2 (Closed)
Patch Set: Created 3 years, 9 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/common/wm/focus_rules.h ('k') | ash/common/wm/fullscreen_window_finder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/focus_rules.cc
diff --git a/ash/common/wm/focus_rules.cc b/ash/common/wm/focus_rules.cc
deleted file mode 100644
index e0634e62ac9fa1fa75e6b5229598ead37b5e8028..0000000000000000000000000000000000000000
--- a/ash/common/wm/focus_rules.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/common/wm/focus_rules.h"
-
-#include "ash/common/shell_delegate.h"
-#include "ash/common/wm/window_state.h"
-#include "ash/common/wm_shell.h"
-#include "ash/common/wm_window.h"
-#include "ash/public/cpp/shell_window_ids.h"
-
-namespace ash {
-
-bool IsToplevelWindow(WmWindow* window) {
- DCHECK(window);
- // The window must in a valid hierarchy.
- if (!window->GetRootWindow())
- return false;
-
- // The window must exist within a container that supports activation.
- // The window cannot be blocked by a modal transient.
- return IsActivatableShellWindowId(window->GetParent()->GetShellWindowId());
-}
-
-bool IsWindowConsideredActivatable(WmWindow* window) {
- DCHECK(window);
- // Only toplevel windows can be activated.
- if (!IsToplevelWindow(window))
- return false;
-
- // The window must be visible.
- return IsWindowConsideredVisibleForActivation(window);
-}
-
-bool IsWindowConsideredVisibleForActivation(WmWindow* window) {
- DCHECK(window);
- // If the |window| doesn't belong to the current active user and also doesn't
- // show for the current active user, then it should not be activated.
- if (!WmShell::Get()->delegate()->CanShowWindowForUser(window))
- return false;
-
- if (window->IsVisible())
- return true;
-
- // Minimized windows are hidden in their minimized state, but they can always
- // be activated.
- if (window->GetWindowState()->IsMinimized())
- return true;
-
- if (!window->GetTargetVisibility())
- return false;
-
- const int parent_shell_window_id = window->GetParent()->GetShellWindowId();
- return parent_shell_window_id == kShellWindowId_DefaultContainer ||
- parent_shell_window_id == kShellWindowId_LockScreenContainer;
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/wm/focus_rules.h ('k') | ash/common/wm/fullscreen_window_finder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698