Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3182)

Unified Diff: chrome/browser/external_tab_container.cc

Issue 39086: Fix a crash in chrome.exe caused by the external tab container instance getti... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/external_tab_container.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/external_tab_container.cc
===================================================================
--- chrome/browser/external_tab_container.cc (revision 10800)
+++ chrome/browser/external_tab_container.cc (working copy)
@@ -35,6 +35,7 @@
}
ExternalTabContainer::~ExternalTabContainer() {
+ Uninitialize(m_hWnd);
}
bool ExternalTabContainer::Init(Profile* profile, HWND parent,
@@ -120,16 +121,18 @@
SetParent(parent);
::ShowWindow(tab_contents_->GetNativeView(), SW_SHOWNA);
-
return true;
}
-void ExternalTabContainer::OnDestroy() {
- views::FocusManager* focus_manager =
- views::FocusManager::GetFocusManager(GetHWND());
- if (focus_manager) {
- focus_manager->RemoveKeystrokeListener(this);
+bool ExternalTabContainer::Uninitialize(HWND window) {
+ if (::IsWindow(window)) {
+ views::FocusManager* focus_manager =
+ views::FocusManager::GetFocusManager(window);
+ if (focus_manager) {
+ focus_manager->RemoveKeystrokeListener(this);
+ }
}
+
root_view_.RemoveAllChildViews(true);
if (tab_contents_) {
NavigationController* controller = tab_contents_->controller();
@@ -139,14 +142,18 @@
NotificationType::EXTERNAL_TAB_CLOSED,
Source<NavigationController>(controller),
Details<ExternalTabContainer>(this));
+
tab_contents_->set_delegate(NULL);
tab_contents_->CloseContents();
// WARNING: tab_contents_ has likely been deleted.
tab_contents_ = NULL;
}
+
+ return true;
}
void ExternalTabContainer::OnFinalMessage(HWND window) {
+ Uninitialize(window);
delete this;
}
« no previous file with comments | « chrome/browser/external_tab_container.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698