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

Unified Diff: ui/wm/core/base_focus_rules.cc

Issue 2809073002: cros: allow aura window not considered activatable for pointer event (Closed)
Patch Set: feedback Created 3 years, 8 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
Index: ui/wm/core/base_focus_rules.cc
diff --git a/ui/wm/core/base_focus_rules.cc b/ui/wm/core/base_focus_rules.cc
index e38aa2e5508dcc9779ea303e54d2d5352e851713..080ca3f8ce70a4daef861aa52c282491a4a34ac8 100644
--- a/ui/wm/core/base_focus_rules.cc
+++ b/ui/wm/core/base_focus_rules.cc
@@ -16,7 +16,7 @@ namespace {
aura::Window* GetFocusedWindow(aura::Window* context) {
aura::client::FocusClient* focus_client =
aura::client::GetFocusClient(context);
- return focus_client ? focus_client->GetFocusedWindow() : NULL;
+ return focus_client ? focus_client->GetFocusedWindow() : nullptr;
}
} // namespace
@@ -24,11 +24,9 @@ aura::Window* GetFocusedWindow(aura::Window* context) {
////////////////////////////////////////////////////////////////////////////////
// BaseFocusRules, protected:
-BaseFocusRules::BaseFocusRules() {
-}
+BaseFocusRules::BaseFocusRules() = default;
-BaseFocusRules::~BaseFocusRules() {
-}
+BaseFocusRules::~BaseFocusRules() = default;
bool BaseFocusRules::IsWindowConsideredVisibleForActivation(
aura::Window* window) const {
@@ -91,6 +89,12 @@ bool BaseFocusRules::CanFocusWindow(aura::Window* window) const {
return window->CanFocus();
}
+bool BaseFocusRules::IsWindowConsideredActivatableForEvent(
+ aura::Window* window,
+ ui::Event* event) const {
+ return true;
+}
+
aura::Window* BaseFocusRules::GetToplevelWindow(aura::Window* window) const {
aura::Window* parent = window->parent();
aura::Window* child = window;
@@ -101,7 +105,7 @@ aura::Window* BaseFocusRules::GetToplevelWindow(aura::Window* window) const {
parent = parent->parent();
child = child->parent();
}
- return NULL;
+ return nullptr;
}
aura::Window* BaseFocusRules::GetActivatableWindow(aura::Window* window) const {
@@ -133,7 +137,7 @@ aura::Window* BaseFocusRules::GetActivatableWindow(aura::Window* window) const {
parent = parent->parent();
child = child->parent();
}
- return NULL;
+ return nullptr;
}
aura::Window* BaseFocusRules::GetFocusableWindow(aura::Window* window) const {
@@ -150,7 +154,7 @@ aura::Window* BaseFocusRules::GetFocusableWindow(aura::Window* window) const {
if (toplevel)
activatable = GetNextActivatableWindow(toplevel);
if (!activatable)
- return NULL;
+ return nullptr;
}
if (!activatable->Contains(window)) {
@@ -172,7 +176,7 @@ aura::Window* BaseFocusRules::GetNextActivatableWindow(
// Can be called from the RootWindow's destruction, which has a NULL parent.
if (!ignore->parent())
- return NULL;
+ return nullptr;
// In the basic scenarios handled by BasicFocusRules, the pool of activatable
// windows is limited to the |ignore|'s siblings.
@@ -188,7 +192,7 @@ aura::Window* BaseFocusRules::GetNextActivatableWindow(
if (CanActivateWindow(cur))
return cur;
}
- return NULL;
+ return nullptr;
}
} // namespace wm

Powered by Google App Engine
This is Rietveld 408576698