| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "views/focus/focus_manager.h" | 7 #include "views/focus/focus_manager.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "views/widget/widget_gtk.h" | 10 #include "views/widget/widget_gtk.h" |
| 11 #include "views/window/window_gtk.h" | 11 #include "views/window/window_gtk.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 void FocusManager::ClearNativeFocus() { | 15 void FocusManager::ClearNativeFocus() { |
| 16 static_cast<WidgetGtk*>(widget_)->ClearNativeFocus(); | 16 static_cast<WidgetGtk*>(widget_->native_widget())->ClearNativeFocus(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void FocusManager::FocusNativeView(gfx::NativeView native_view) { | 19 void FocusManager::FocusNativeView(gfx::NativeView native_view) { |
| 20 if (native_view && !gtk_widget_is_focus(native_view)) | 20 if (native_view && !gtk_widget_is_focus(native_view)) |
| 21 gtk_widget_grab_focus(native_view); | 21 gtk_widget_grab_focus(native_view); |
| 22 } | 22 } |
| 23 | 23 |
| 24 // static | 24 // static |
| 25 FocusManager* FocusManager::GetFocusManagerForNativeView( | 25 FocusManager* FocusManager::GetFocusManagerForNativeView( |
| 26 gfx::NativeView native_view) { | 26 gfx::NativeView native_view) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 return focus_manager; | 41 return focus_manager; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 FocusManager* FocusManager::GetFocusManagerForNativeWindow( | 45 FocusManager* FocusManager::GetFocusManagerForNativeWindow( |
| 46 gfx::NativeWindow native_window) { | 46 gfx::NativeWindow native_window) { |
| 47 return GetFocusManagerForNativeView(GTK_WIDGET(native_window)); | 47 return GetFocusManagerForNativeView(GTK_WIDGET(native_window)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 } // namespace views | 50 } // namespace views |
| OLD | NEW |