OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/external_tab_container_win.h" | 5 #include "chrome/browser/ui/views/external_tab_container_win.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 set_delegate(this); | 264 set_delegate(this); |
265 return true; | 265 return true; |
266 } | 266 } |
267 | 267 |
268 void ExternalTabContainerWin::Uninitialize() { | 268 void ExternalTabContainerWin::Uninitialize() { |
269 registrar_.RemoveAll(); | 269 registrar_.RemoveAll(); |
270 if (tab_contents_.get()) { | 270 if (tab_contents_.get()) { |
271 UnregisterRenderViewHost( | 271 UnregisterRenderViewHost( |
272 tab_contents_->web_contents()->GetRenderViewHost()); | 272 tab_contents_->web_contents()->GetRenderViewHost()); |
273 | 273 |
274 // Explicitly tell the RPH to shutdown, as doing so is the only thing that | |
275 // cleans up certain resources like infobars (crbug.com/148398). | |
276 tab_contents_->web_contents()-> | |
277 GetRenderProcessHost()->FastShutdownIfPossible(); | |
278 | |
279 if (GetWidget()->GetRootView()) | 274 if (GetWidget()->GetRootView()) |
280 GetWidget()->GetRootView()->RemoveAllChildViews(true); | 275 GetWidget()->GetRootView()->RemoveAllChildViews(true); |
281 | 276 |
282 content::NotificationService::current()->Notify( | 277 content::NotificationService::current()->Notify( |
283 chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, | 278 chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, |
284 content::Source<NavigationController>( | 279 content::Source<NavigationController>( |
285 &tab_contents_->web_contents()->GetController()), | 280 &tab_contents_->web_contents()->GetController()), |
286 content::Details<ExternalTabContainer>(this)); | 281 content::Details<ExternalTabContainer>(this)); |
287 | 282 |
288 tab_contents_.reset(NULL); | 283 tab_contents_.reset(NULL); |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 if (params.disposition == CURRENT_TAB) { | 1283 if (params.disposition == CURRENT_TAB) { |
1289 DCHECK(route_all_top_level_navigations_); | 1284 DCHECK(route_all_top_level_navigations_); |
1290 forward_params.disposition = NEW_FOREGROUND_TAB; | 1285 forward_params.disposition = NEW_FOREGROUND_TAB; |
1291 } | 1286 } |
1292 WebContents* new_contents = | 1287 WebContents* new_contents = |
1293 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1288 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
1294 // support only one navigation for a dummy tab before it is killed. | 1289 // support only one navigation for a dummy tab before it is killed. |
1295 ::DestroyWindow(GetNativeView()); | 1290 ::DestroyWindow(GetNativeView()); |
1296 return new_contents; | 1291 return new_contents; |
1297 } | 1292 } |
OLD | NEW |