diff options
Diffstat (limited to 'ui/aura/window.cc')
-rw-r--r-- | ui/aura/window.cc | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 1a2df24..5bd9429 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -525,18 +525,20 @@ Window* Window::GetToplevelWindow() { } void Window::Focus() { - DCHECK(GetFocusManager()); - GetFocusManager()->SetFocusedWindow(this, NULL); + client::FocusClient* client = client::GetFocusClient(this); + DCHECK(client); + client->FocusWindow(this, NULL); } void Window::Blur() { - DCHECK(GetFocusManager()); - GetFocusManager()->SetFocusedWindow(NULL, NULL); + client::FocusClient* client = client::GetFocusClient(this); + DCHECK(client); + client->FocusWindow(NULL, NULL); } bool Window::HasFocus() const { - const FocusManager* focus_manager = GetFocusManager(); - return focus_manager ? focus_manager->IsFocusedWindow(this) : false; + client::FocusClient* client = client::GetFocusClient(this); + return client && client->GetFocusedWindow() == this; } bool Window::CanFocus() const { @@ -565,15 +567,6 @@ bool Window::CanReceiveEvents() const { return parent_ && IsVisible() && parent_->CanReceiveEvents(); } -FocusManager* Window::GetFocusManager() { - return const_cast<FocusManager*>( - static_cast<const Window*>(this)->GetFocusManager()); -} - -const FocusManager* Window::GetFocusManager() const { - return parent_ ? parent_->GetFocusManager() : NULL; -} - void Window::SetCapture() { if (!IsVisible()) return; |