diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 18:22:10 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 18:22:10 +0000 |
commit | 0c96668965e17a98f29b6862468783e5a04af0d7 (patch) | |
tree | 0386d0b802abcb6bc0c143648bdbfaaea6cdb154 /ui/views | |
parent | 134efc37e03e2d8da955f855533fbb5c7c6177f1 (diff) | |
download | chromium_src-0c96668965e17a98f29b6862468783e5a04af0d7.zip chromium_src-0c96668965e17a98f29b6862468783e5a04af0d7.tar.gz chromium_src-0c96668965e17a98f29b6862468783e5a04af0d7.tar.bz2 |
Nix GetFocusManagerForNativeView|Window.
Use Widget|View::GetFocusManager instead.
Use Widget::Get[TopLevel]WidgetForNativeView|Window as necessary.
BUG=88718
TEST=none
Review URL: http://codereview.chromium.org/7532015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/focus/accelerator_handler_win.cc | 5 | ||||
-rw-r--r-- | ui/views/focus/focus_manager.cc | 16 | ||||
-rw-r--r-- | ui/views/focus/focus_manager.h | 8 |
3 files changed, 3 insertions, 26 deletions
diff --git a/ui/views/focus/accelerator_handler_win.cc b/ui/views/focus/accelerator_handler_win.cc index 5efdab8..ab059ec 100644 --- a/ui/views/focus/accelerator_handler_win.cc +++ b/ui/views/focus/accelerator_handler_win.cc @@ -8,6 +8,7 @@ #include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "ui/views/events/event.h" #include "ui/views/focus/focus_manager.h" +#include "ui/views/widget/widget.h" namespace ui { @@ -18,8 +19,8 @@ bool AcceleratorHandler::Dispatch(const MSG& msg) { bool process_message = true; if (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) { - FocusManager* focus_manager = - FocusManager::GetFocusManagerForNativeView(msg.hwnd); + Widget* widget = Widget::GetTopLevelWidgetForNativeView(msg.hwnd); + FocusManager* focus_manager = widget ? widget->GetFocusManager() : NULL; if (focus_manager) { switch (msg.message) { case WM_KEYDOWN: diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc index 6e1e953..efe65b1 100644 --- a/ui/views/focus/focus_manager.cc +++ b/ui/views/focus/focus_manager.cc @@ -326,22 +326,6 @@ 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; -} - //////////////////////////////////////////////////////////////////////////////// // FocusManager, private: diff --git a/ui/views/focus/focus_manager.h b/ui/views/focus/focus_manager.h index a132ccc..2236619 100644 --- a/ui/views/focus/focus_manager.h +++ b/ui/views/focus/focus_manager.h @@ -251,14 +251,6 @@ class FocusManager { // pressed). static bool IsTabTraversalKeyEvent(const KeyEvent& key_event); - // Retrieves the FocusManager associated with the passed native view. - static FocusManager* GetFocusManagerForNativeView( - gfx::NativeView native_view); - - // Retrieves the FocusManager associated with the passed native view. - static FocusManager* GetFocusManagerForNativeWindow( - gfx::NativeWindow native_window); - private: // Returns the next focusable view. View* GetNextFocusableView(View* starting_view, |