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

Unified Diff: ui/aura/window.cc

Issue 8770011: aura: Ask the WindowDelegate before a Window is Focus()ed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 915623bc094aaa4b8988f599c998a53d49538c9b..4f904ddc4dc9ab33d096f0e3ef8d5557cce618f2 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -373,8 +373,7 @@ bool Window::HasFocus() const {
// propagation of events that would otherwise be targeted at windows behind it.
// We then perform this same check on every window up to the root.
bool Window::CanFocus() const {
- // TODO(beng): Figure out how to consult the delegate wrt. focusability also.
- if (!IsVisible() || !parent_)
+ if (!IsVisible() || !parent_ || (delegate_ && !delegate_->CanFocus()))
return false;
Windows::const_iterator i = std::find(parent_->children().begin(),
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/aura/window_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698