Index: ash/wm/ash_focus_rules.cc |
diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc |
index 54402f29a5cda6e16117f1b4e3dd4cc2c56c0a3b..d52d89e171927bfdaaa5f3a549dd1cb586dfe0ec 100644 |
--- a/ash/wm/ash_focus_rules.cc |
+++ b/ash/wm/ash_focus_rules.cc |
@@ -13,7 +13,9 @@ |
#include "ash/wm/window_state_aura.h" |
#include "ash/wm_shell.h" |
#include "ash/wm_window.h" |
+#include "ui/aura/client/aura_constants.h" |
#include "ui/aura/window.h" |
+#include "ui/events/event.h" |
namespace ash { |
namespace wm { |
@@ -33,13 +35,9 @@ bool BelongsToContainerWithEqualOrGreaterId(const aura::Window* window, |
//////////////////////////////////////////////////////////////////////////////// |
// AshFocusRules, public: |
-AshFocusRules::AshFocusRules() {} |
+AshFocusRules::AshFocusRules() = default; |
-AshFocusRules::~AshFocusRules() {} |
- |
-bool AshFocusRules::IsWindowConsideredActivatable(aura::Window* window) const { |
- return ash::IsWindowConsideredActivatable(WmWindow::Get(window)); |
-} |
+AshFocusRules::~AshFocusRules() = default; |
//////////////////////////////////////////////////////////////////////////////// |
// AshFocusRules, ::wm::FocusRules: |
@@ -73,6 +71,18 @@ bool AshFocusRules::CanActivateWindow(aura::Window* window) const { |
return true; |
} |
+bool AshFocusRules::IsWindowConsideredActivatableForEvent( |
+ aura::Window* window, |
+ ui::Event* event) const { |
+ if (!window) |
+ return true; |
+ |
+ if (event->IsMouseEvent()) |
+ return window->GetProperty(aura::client::kActivateOnClickKey); |
+ |
+ return true; |
+} |
+ |
aura::Window* AshFocusRules::GetNextActivatableWindow( |
aura::Window* ignore) const { |
DCHECK(ignore); |
@@ -141,7 +151,7 @@ aura::Window* AshFocusRules::GetTopmostWindowToActivateInContainer( |
!window_state->IsMinimized()) |
return *i; |
} |
- return NULL; |
+ return nullptr; |
} |
} // namespace wm |