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

Unified Diff: ui/aura/window.cc

Issue 11299219: Rework FocusManager as FocusClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/window.h ('k') | ui/views/controls/native/native_view_host_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
===================================================================
--- ui/aura/window.cc (revision 169818)
+++ ui/aura/window.cc (working copy)
@@ -525,18 +525,20 @@
}
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 : false;
}
bool Window::CanFocus() const {
@@ -565,15 +567,6 @@
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;
« no previous file with comments | « ui/aura/window.h ('k') | ui/views/controls/native/native_view_host_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698