summaryrefslogtreecommitdiffstats
path: root/views/widget/root_view.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:48:00 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-30 18:48:00 +0000
commit82166b65c8cdd7cb855c2d018be8c6c815324af6 (patch)
treef96034ed91ce66d6a3ba2afa07cdd4be1e55b264 /views/widget/root_view.cc
parent7811b768ff61d58153a198a273cdb39581a77542 (diff)
downloadchromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.zip
chromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.tar.gz
chromium_src-82166b65c8cdd7cb855c2d018be8c6c815324af6.tar.bz2
This CL removes the last (major) Windows specific part out of the focus manager.
It was previously landed and reverted because it broke the reliability tests. http://codereview.chromium.org/125148 The breakage was caused by constrained windows not getting a hold of the FocusManager when in unparented tabs. The fix is to ensure unparented tab still have a way to access their FocusManager for proper closure. Files changed from the previous patch that need reviewing: native_tab_contents_container_win.cc tab_contents_view_win.h tab_contents_view_win.cc BUG=None TEST=Run all tests (unit, ui, interactive). Extensively test the focus in Chrome. Review URL: http://codereview.chromium.org/146093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/root_view.cc')
-rw-r--r--views/widget/root_view.cc21
1 files changed, 4 insertions, 17 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index becc57a..6082e2d 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -46,7 +46,7 @@ class PaintTask : public Task {
// 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 @@ void RootView::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
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 @@ void RootView::OnWidgetDestroyed() {
// TODO(port): Port RootViewDropTarget and this goes away.
NOTIMPLEMENTED();
#endif
- widget_ = NULL;
}
void RootView::ProcessMouseDragCanceled() {