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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 BlockedContentTabHelper::FromWebContents(existing_contents)-> | 259 BlockedContentTabHelper::FromWebContents(existing_contents)-> |
260 set_delegate(this); | 260 set_delegate(this); |
261 return true; | 261 return true; |
262 } | 262 } |
263 | 263 |
264 void ExternalTabContainerWin::Uninitialize() { | 264 void ExternalTabContainerWin::Uninitialize() { |
265 registrar_.RemoveAll(); | 265 registrar_.RemoveAll(); |
266 if (web_contents_.get()) { | 266 if (web_contents_.get()) { |
267 UnregisterRenderViewHost(web_contents_->GetRenderViewHost()); | 267 UnregisterRenderViewHost(web_contents_->GetRenderViewHost()); |
268 | 268 |
| 269 // Explicitly tell the RPH to shutdown, as doing so is the only thing that |
| 270 // cleans up certain resources like infobars (crbug.com/148398). |
| 271 web_contents_->GetRenderProcessHost()->FastShutdownIfPossible(); |
| 272 |
269 if (GetWidget()->GetRootView()) | 273 if (GetWidget()->GetRootView()) |
270 GetWidget()->GetRootView()->RemoveAllChildViews(true); | 274 GetWidget()->GetRootView()->RemoveAllChildViews(true); |
271 | 275 |
272 content::NotificationService::current()->Notify( | 276 content::NotificationService::current()->Notify( |
273 chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, | 277 chrome::NOTIFICATION_EXTERNAL_TAB_CLOSED, |
274 content::Source<NavigationController>(&web_contents_->GetController()), | 278 content::Source<NavigationController>(&web_contents_->GetController()), |
275 content::Details<ExternalTabContainer>(this)); | 279 content::Details<ExternalTabContainer>(this)); |
276 | 280 |
277 web_contents_.reset(NULL); | 281 web_contents_.reset(NULL); |
278 } | 282 } |
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 if (params.disposition == CURRENT_TAB) { | 1279 if (params.disposition == CURRENT_TAB) { |
1276 DCHECK(route_all_top_level_navigations_); | 1280 DCHECK(route_all_top_level_navigations_); |
1277 forward_params.disposition = NEW_FOREGROUND_TAB; | 1281 forward_params.disposition = NEW_FOREGROUND_TAB; |
1278 } | 1282 } |
1279 WebContents* new_contents = | 1283 WebContents* new_contents = |
1280 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); | 1284 ExternalTabContainerWin::OpenURLFromTab(source, forward_params); |
1281 // support only one navigation for a dummy tab before it is killed. | 1285 // support only one navigation for a dummy tab before it is killed. |
1282 ::DestroyWindow(GetNativeView()); | 1286 ::DestroyWindow(GetNativeView()); |
1283 return new_contents; | 1287 return new_contents; |
1284 } | 1288 } |
OLD | NEW |