From 3c59ef0629260028c98b9648ee7e6732b24018a0 Mon Sep 17 00:00:00 2001 From: "jcampan@chromium.org" Date: Mon, 8 Jun 2009 23:33:23 +0000 Subject: 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 --- views/focus/focus_manager.cc | 28 ++-------------------------- views/focus/focus_manager.h | 3 --- 2 files changed, 2 insertions(+), 29 deletions(-) (limited to 'views/focus') 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 #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 -- cgit v1.1