diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 23:33:23 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 23:33:23 +0000 |
commit | 3c59ef0629260028c98b9648ee7e6732b24018a0 (patch) | |
tree | 3ce67f67d5754b5089628433cdd1298d7ea10b0a /views/focus | |
parent | 1f082083982da6f2261a2bc1bb74247a903ba2ee (diff) | |
download | chromium_src-3c59ef0629260028c98b9648ee7e6732b24018a0.zip chromium_src-3c59ef0629260028c98b9648ee7e6732b24018a0.tar.gz chromium_src-3c59ef0629260028c98b9648ee7e6732b24018a0.tar.bz2 |
Moving the Windows specific activation code in the FocusManager to the widget_win.
BUG=None
TEST=Test that the focus in the browser works well: that windows remember which view had focus when deactivated/reactivated. Make sure focus traversal works as expected.
Review URL: http://codereview.chromium.org/118406
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17911 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/focus_manager.cc | 28 | ||||
-rw-r--r-- | views/focus/focus_manager.h | 3 |
2 files changed, 2 insertions, 29 deletions
diff --git a/views/focus/focus_manager.cc b/views/focus/focus_manager.cc index 04258bf..046d6ea 100644 --- a/views/focus/focus_manager.cc +++ b/views/focus/focus_manager.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "views/focus/focus_manager.h" + #include <algorithm> #include "build/build_config.h" @@ -13,7 +15,6 @@ #include "base/histogram.h" #include "base/logging.h" #include "views/accelerator.h" -#include "views/focus/focus_manager.h" #include "views/focus/view_storage.h" #include "views/view.h" #include "views/widget/root_view.h" @@ -78,20 +79,6 @@ static LRESULT CALLBACK FocusWindowCallback(HWND window, UINT message, if (!focus_manager->OnNCDestroy(window)) return 0; break; - case WM_ACTIVATE: { - // We call the DefWindowProc before calling OnActivate as some of our - // windows need the OnActivate notifications. The default activation on - // the window causes it to focus the main window, and since - // FocusManager::OnActivate attempts to restore the focused view, it - // needs to be called last so the focus it is setting does not get - // overridden. - LRESULT result = CallWindowProc(original_handler, window, WM_ACTIVATE, - wParam, lParam); - if (!focus_manager->OnPostActivate(window, - LOWORD(wParam), HIWORD(wParam))) - return 0; - return result; - } default: break; } @@ -335,17 +322,6 @@ bool FocusManager::OnKeyUp(HWND window, UINT message, WPARAM wparam, return true; } - -bool FocusManager::OnPostActivate(HWND window, - int activation_state, - int minimized_state) { - if (WA_INACTIVE == LOWORD(activation_state)) { - StoreFocusedView(); - } else { - RestoreFocusedView(); - } - return false; -} #endif void FocusManager::ValidateFocusedView() { diff --git a/views/focus/focus_manager.h b/views/focus/focus_manager.h index 28abcde..4c7f6ce 100644 --- a/views/focus/focus_manager.h +++ b/views/focus/focus_manager.h @@ -189,9 +189,6 @@ class FocusManager { UINT message, WPARAM wparam, LPARAM lparam); - // OnPostActivate is called after WM_ACTIVATE has been propagated to the - // DefWindowProc. - bool OnPostActivate(HWND window, int activation_state, int minimized_state); #endif // Returns true is the specified is part of the hierarchy of the window |