diff options
-rw-r--r-- | chrome/browser/external_tab_container.cc | 21 | ||||
-rw-r--r-- | chrome/browser/views/tab_contents/native_tab_contents_container_win.cc | 16 |
2 files changed, 11 insertions, 26 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index a8490ae..70c3eaf 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -59,10 +59,6 @@ bool ExternalTabContainer::Init(Profile* profile, // is the same as the lifetime of the window SetProp(GetNativeView(), kWindowObjectKey, this); - views::FocusManager* focus_manager = - views::FocusManager::GetFocusManager(GetNativeView()); - focus_manager->AddKeystrokeListener(this); - tab_contents_ = new TabContents(profile, NULL, MSG_ROUTING_NONE, NULL); tab_contents_->set_delegate(this); tab_contents_->render_view_host()->AllowExternalHostBindings(); @@ -250,14 +246,8 @@ ExtensionFunctionDispatcher* ExternalTabContainer:: bool ExternalTabContainer::TakeFocus(bool reverse) { if (automation_) { - views::FocusManager* focus_manager = - views::FocusManager::GetFocusManager(GetNativeView()); - DCHECK(focus_manager); - if (focus_manager) { - focus_manager->ClearFocus(); - automation_->Send(new AutomationMsg_TabbedOut(0, tab_handle_, - win_util::IsShiftPressed())); - } + automation_->Send(new AutomationMsg_TabbedOut(0, tab_handle_, + win_util::IsShiftPressed())); } return true; @@ -378,13 +368,6 @@ bool ExternalTabContainer::ProcessKeyStroke(HWND window, UINT message, // ExternalTabContainer, private: void ExternalTabContainer::Uninitialize(HWND window) { - if (::IsWindow(window)) { - views::FocusManager* focus_manager = - views::FocusManager::GetFocusManager(window); - if (focus_manager) - focus_manager->RemoveKeystrokeListener(this); - } - if (tab_contents_) { NotificationService::current()->Notify( NotificationType::EXTERNAL_TAB_CLOSED, diff --git a/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc b/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc index 42a4357..8dccc4c 100644 --- a/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc +++ b/chrome/browser/views/tab_contents/native_tab_contents_container_win.cc @@ -42,16 +42,18 @@ void NativeTabContentsContainerWin::DetachContents(TabContents* contents) { // TODO(brettw) should this move to NativeViewHost::Detach which is called below? // It needs cleanup regardless. HWND container_hwnd = contents->GetNativeView(); + if (container_hwnd) { + // Hide the contents before adjusting its parent to avoid a full desktop + // flicker. + ShowWindow(container_hwnd, SW_HIDE); - // Hide the contents before adjusting its parent to avoid a full desktop - // flicker. - ShowWindow(container_hwnd, SW_HIDE); + // Reset the parent to NULL to ensure hidden tabs don't receive messages. + ::SetParent(container_hwnd, NULL); - // Reset the parent to NULL to ensure hidden tabs don't receive messages. - ::SetParent(container_hwnd, NULL); + // Unregister the tab contents window from the FocusManager. + views::FocusManager::UninstallFocusSubclass(container_hwnd); + } - // Unregister the tab contents window from the FocusManager. - views::FocusManager::UninstallFocusSubclass(container_hwnd); HWND hwnd = contents->GetContentNativeView(); if (hwnd) { // We may not have an HWND anymore, if the renderer crashed and we are |