summaryrefslogtreecommitdiffstats
path: root/ui/views/focus/focus_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/views/focus/focus_manager.cc')
-rw-r--r--ui/views/focus/focus_manager.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc
index c2c7aa8..5039918 100644
--- a/ui/views/focus/focus_manager.cc
+++ b/ui/views/focus/focus_manager.cc
@@ -325,7 +325,7 @@ void FocusManager::SetFocusedViewWithReason(
void FocusManager::ClearFocus() {
SetFocusedView(NULL);
- ClearNativeFocus();
+ widget_->native_widget()->FocusNativeView(NULL);
}
void FocusManager::StoreFocusedView() {
@@ -504,6 +504,22 @@ bool FocusManager::IsTabTraversalKeyEvent(const KeyEvent& key_event) {
!key_event.IsControlDown();
}
+// static
+FocusManager* FocusManager::GetFocusManagerForNativeView(
+ gfx::NativeView native_view) {
+ NativeWidget* native_widget =
+ NativeWidget::GetNativeWidgetForNativeView(native_view);
+ return native_widget ? native_widget->GetWidget()->GetFocusManager() : NULL;
+}
+
+// static
+FocusManager* FocusManager::GetFocusManagerForNativeWindow(
+ gfx::NativeWindow native_window) {
+ NativeWidget* native_widget =
+ NativeWidget::GetNativeWidgetForNativeWindow(native_window);
+ return native_widget ? native_widget->GetWidget()->GetFocusManager() : NULL;
+}
+
void FocusManager::ViewRemoved(View* parent, View* removed) {
if (focused_view_ && focused_view_ == removed)
ClearFocus();