| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/l10n_util.h" | 5 #include "app/l10n_util.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/browser_list.h" | 8 #include "chrome/browser/browser_list.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 IPC::Message* m = new IPC::Message(message); | 84 IPC::Message* m = new IPC::Message(message); |
| 85 m->set_routing_id(target_host->routing_id()); | 85 m->set_routing_id(target_host->routing_id()); |
| 86 target_host->Send(m); | 86 target_host->Send(m); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void DevToolsWindow::InspectedTabClosing() { | 89 void DevToolsWindow::InspectedTabClosing() { |
| 90 if (docked_) { | 90 if (docked_) { |
| 91 // Update dev tools to reflect removed dev tools window. | 91 // Update dev tools to reflect removed dev tools window. |
| 92 inspected_window_->UpdateDevTools(); | 92 inspected_window_->UpdateDevTools(); |
| 93 // In case of docked tab_contents we own it, so delete here. | 93 // In case of docked tab_contents we own it, so delete here. |
| 94 delete tab_contents_; |
| 94 | 95 |
| 95 // Instead of deleting tab contents, we add it into the | |
| 96 // stub browser and initiate regular closure; | |
| 97 Browser* b = Browser::Create(profile_); | |
| 98 b->tabstrip_model()->AddTabContents(tab_contents_, -1, false, | |
| 99 PageTransition::START_PAGE, true); | |
| 100 b->CloseAllTabs(); | |
| 101 delete this; | 96 delete this; |
| 102 } else { | 97 } else { |
| 103 // First, initiate self-destruct to free all the registrars. | 98 // First, initiate self-destruct to free all the registrars. |
| 104 // Then close all tabs. Browser will take care of deleting tab_contents | 99 // Then close all tabs. Browser will take care of deleting tab_contents |
| 105 // for us. | 100 // for us. |
| 106 Browser* browser = browser_; | 101 Browser* browser = browser_; |
| 107 delete this; | 102 delete this; |
| 108 browser->CloseAllTabs(); | 103 browser->CloseAllTabs(); |
| 109 } | 104 } |
| 110 } | 105 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 &tab_contents_->controller()) { | 212 &tab_contents_->controller()) { |
| 218 // This happens when browser closes all of its tabs as a result | 213 // This happens when browser closes all of its tabs as a result |
| 219 // of window.Close event. | 214 // of window.Close event. |
| 220 // Notify manager that this DevToolsClientHost no longer exists and | 215 // Notify manager that this DevToolsClientHost no longer exists and |
| 221 // initiate self-destuct here. | 216 // initiate self-destuct here. |
| 222 NotifyCloseListener(); | 217 NotifyCloseListener(); |
| 223 delete this; | 218 delete this; |
| 224 } | 219 } |
| 225 } | 220 } |
| 226 } | 221 } |
| OLD | NEW |