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

Unified Diff: ash/wm/focus_rules.cc

Issue 2985453003: fix shelf color with modal dialog. (Closed)
Patch Set: fix tests Created 3 years, 5 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/shelf/shelf_layout_manager_unittest.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/focus_rules.cc
diff --git a/ash/wm/focus_rules.cc b/ash/wm/focus_rules.cc
index b1ca005377ded3d6b17c0961ef0e83dc45599118..0decb790f81ac1d6a3813ef8e81106e87441b7f6 100644
--- a/ash/wm/focus_rules.cc
+++ b/ash/wm/focus_rules.cc
@@ -9,6 +9,7 @@
#include "ash/shell_delegate.h"
#include "ash/wm/window_state.h"
#include "ui/aura/window.h"
+#include "ui/wm/public/activation_delegate.h"
namespace ash {
@@ -29,8 +30,15 @@ bool IsWindowConsideredActivatable(aura::Window* window) {
if (!IsToplevelWindow(window))
return false;
- // The window must be visible.
- return IsWindowConsideredVisibleForActivation(window);
+ if (!IsWindowConsideredVisibleForActivation(window))
+ return false;
+
+ if (::wm::GetActivationDelegate(window) &&
+ !::wm::GetActivationDelegate(window)->ShouldActivate()) {
+ return false;
+ }
+
+ return window->CanFocus();
}
bool IsWindowConsideredVisibleForActivation(aura::Window* window) {
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698