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

Unified Diff: views/widget/root_view.cc

Issue 141013: Relanding focus manager refactoring (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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
« no previous file with comments | « views/widget/accelerator_handler.cc ('k') | views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/root_view.cc
===================================================================
--- views/widget/root_view.cc (revision 18879)
+++ views/widget/root_view.cc (working copy)
@@ -46,7 +46,7 @@
// The target root view.
RootView* root_view_;
- DISALLOW_EVIL_CONSTRUCTORS(PaintTask);
+ DISALLOW_COPY_AND_ASSIGN(PaintTask);
};
const char RootView::kViewClassName[] = "views/RootView";
@@ -262,23 +262,11 @@
default_keyboard_handler_ = NULL;
}
- // For a given widget hierarchy, focus is tracked by a FocusManager attached
- // to our nearest enclosing Window. <-- Important Assumption!
- // We may not have access to our window if this function is called as a
- // result of teardown during the deletion of the RootView and its hierarchy,
- // so we don't bother notifying the FocusManager in that case because it
- // will have already been destroyed (the Widget that contains us is
- // NCDESTROY'ed which in turn destroys the focus manager _before_ the
- // RootView is deleted.)
-#if defined(OS_WIN)
- Window* window = GetWindow();
- if (window) {
- FocusManager* focus_manager =
- FocusManager::GetFocusManager(window->GetNativeWindow());
+ FocusManager* focus_manager = widget_->GetFocusManager();
+ // An unparanted RootView does not have a FocusManager.
+ if (focus_manager)
focus_manager->ViewRemoved(parent, child);
- }
ViewStorage::GetSharedInstance()->ViewRemoved(parent, child);
-#endif
}
}
@@ -521,7 +509,6 @@
// TODO(port): Port RootViewDropTarget and this goes away.
NOTIMPLEMENTED();
#endif
- widget_ = NULL;
}
void RootView::ProcessMouseDragCanceled() {
« no previous file with comments | « views/widget/accelerator_handler.cc ('k') | views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698