Commit c250d022 authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: remove extensions-related workaround from the docked devtools window destruction.

Review URL: http://codereview.chromium.org/155206

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20139 0039d316-1c4b-4281-b951-d872f2087c98
parent e17a8a15
......@@ -91,13 +91,8 @@ void DevToolsWindow::InspectedTabClosing() {
// Update dev tools to reflect removed dev tools window.
inspected_window_->UpdateDevTools();
// In case of docked tab_contents we own it, so delete here.
delete tab_contents_;
// Instead of deleting tab contents, we add it into the
// stub browser and initiate regular closure;
Browser* b = Browser::Create(profile_);
b->tabstrip_model()->AddTabContents(tab_contents_, -1, false,
PageTransition::START_PAGE, true);
b->CloseAllTabs();
delete this;
} else {
// First, initiate self-destruct to free all the registrars.
......
......@@ -268,7 +268,19 @@ void ExtensionBrowserEventRouter::TabUpdated(TabContents* contents,
bool did_navigate) {
int tab_id = ExtensionTabUtil::GetTabId(contents);
std::map<int, TabEntry>::iterator i = tab_entries_.find(tab_id);
CHECK(tab_entries_.end() != i);
if(tab_entries_.end() == i) {
// TODO(rafaelw): Unregister EBER on TAB_CONTENTS_DESTROYED in order
// not to receive NAV_ENTRY_COMMITTED from objects that are allocated
// at the same address as previously deleted TabContents.
//
// The problem here is that NAV_ENTRY_COMMITTED is issued by the navigation
// controller independently from tabstrip model. One should not rely upon
// TabStripModelObserver events when registering / unregistering
// tab contents events' handlers.
registrar_.Remove(this, NotificationType::NAV_ENTRY_COMMITTED,
Source<NavigationController>(&contents->controller()));
return;
}
TabEntry& entry = i->second;
DictionaryValue* changed_properties = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment