summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-28 23:02:27 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-28 23:02:27 +0000
commit597ecc3d0aacc8ac895771f1478a9b04107d5df0 (patch)
tree01727379df70eda9663c278c29695c8fd9506ca3
parent6a4f8154c76a16856fcdc014271cbf33b7e42643 (diff)
downloadchromium_src-597ecc3d0aacc8ac895771f1478a9b04107d5df0.zip
chromium_src-597ecc3d0aacc8ac895771f1478a9b04107d5df0.tar.gz
chromium_src-597ecc3d0aacc8ac895771f1478a9b04107d5df0.tar.bz2
Merge 53206 - Fix incorrect focus cycling issues in ChromeFrame full tab mode. This happens whenever a tab rendering a chrome frame
page receives focus by switching to it. Whenever we receive focus in ChromeFrame we send over an IPC to set the initial focus to Chrome. In this IPc we invoke the FocusThroughTabTraversal function on the TabContents which basically cycles through the focus on the page which is not correct for full tab mode. Fix is to handle the WM_SETFOCUS message in the active document and invoke the GiveFocusToChrome with false indicating that we don't want to invoke the FocusThroughTabTraversal function which cycles through the view. It is sufficient to set focus to the tab. We also handle the WM_SHOWWINDOW message in the active document and set focus to the document if it is visible. This ensures that the page gets focused correctly. Fixes bug http://code.google.com/p/chromium/issues/detail?id=48459 Fixes bug http://code.google.com/p/chromium/issues/detail?id=25890 Bug=48459, 25890 Review URL: http://codereview.chromium.org/2825061 TBR=ananta@chromium.org Review URL: http://codereview.chromium.org/3075006 git-svn-id: svn://svn.chromium.org/chrome/branches/472/src@54059 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome_frame/chrome_active_document.cc15
-rw-r--r--chrome_frame/chrome_active_document.h8
2 files changed, 22 insertions, 1 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index 899ec80..66ee3c0 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -1264,6 +1264,21 @@ LRESULT ChromeActiveDocument::OnFirePrivacyChange(UINT message, WPARAM wparam,
return 0;
}
+LRESULT ChromeActiveDocument::OnShowWindow(UINT message, WPARAM wparam,
+ LPARAM lparam,
+ BOOL& handled) { // NO_LINT
+ if (wparam)
+ SetFocus();
+ return 0;
+}
+
+LRESULT ChromeActiveDocument::OnSetFocus(UINT message, WPARAM wparam,
+ LPARAM lparam,
+ BOOL& handled) { // NO_LINT
+ GiveFocusToChrome(false);
+ return 0;
+}
+
namespace {
struct ModuleAndVersion {
const char* module_name_;
diff --git a/chrome_frame/chrome_active_document.h b/chrome_frame/chrome_active_document.h
index 6bd8e4d..39b0e74 100644
--- a/chrome_frame/chrome_active_document.h
+++ b/chrome_frame/chrome_active_document.h
@@ -236,6 +236,8 @@ BEGIN_MSG_MAP(ChromeActiveDocument)
MESSAGE_HANDLER(WM_FIRE_PRIVACY_CHANGE_NOTIFICATION, OnFirePrivacyChange)
COMMAND_ID_HANDLER(IDC_CHROMEFRAME_FORWARD, OnForward)
COMMAND_ID_HANDLER(IDC_CHROMEFRAME_BACK, OnBack)
+ MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow)
+ MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus)
CHAIN_MSG_MAP(BaseActiveX)
END_MSG_MAP()
@@ -340,7 +342,7 @@ END_EXEC_COMMAND_MAP()
bool PreProcessContextMenu(HMENU menu);
bool HandleContextMenuCommand(UINT cmd, const IPC::ContextMenuParams& params);
- // ChromeFramePlugin overrides.
+ // ChromeFramePlugin overrides.
virtual void OnAutomationServerReady();
// IEnumPrivacyRecords
@@ -421,6 +423,10 @@ END_EXEC_COMMAND_MAP()
LRESULT OnFirePrivacyChange(UINT message, WPARAM wparam, LPARAM lparam,
BOOL& handled);
+ LRESULT OnShowWindow(UINT message, WPARAM wparam, LPARAM lparam,
+ BOOL& handled);
+ LRESULT OnSetFocus(UINT message, WPARAM wparam, LPARAM lparam,
+ BOOL& handled);
// Checks for the presence of known-to-be-buggy BHOs. If we find any
// we do not fire the DocumentComplete event to avoid a crash.