 Chromium Code Reviews
 Chromium Code Reviews Issue 6319001:
  Support window.opener after a process swap.   (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 6319001:
  Support window.opener after a process swap.   (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/render_widget_host.h" | 5 #include "content/browser/renderer_host/render_widget_host.h" | 
| 6 | 6 | 
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" | 
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" | 
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" | 
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" | 
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 // By invoking WasResized the renderer is updated as necessary. WasResized | 293 // By invoking WasResized the renderer is updated as necessary. WasResized | 
| 294 // does nothing if the sizes are already in sync. | 294 // does nothing if the sizes are already in sync. | 
| 295 // | 295 // | 
| 296 // TODO: ideally ViewMsg_WasRestored would take a size. This way, the renderer | 296 // TODO: ideally ViewMsg_WasRestored would take a size. This way, the renderer | 
| 297 // could handle both the restore and resize at once. This isn't that big a | 297 // could handle both the restore and resize at once. This isn't that big a | 
| 298 // deal as RenderWidget::WasRestored delays updating, so that the resize from | 298 // deal as RenderWidget::WasRestored delays updating, so that the resize from | 
| 299 // WasResized is usually processed before the renderer is painted. | 299 // WasResized is usually processed before the renderer is painted. | 
| 300 WasResized(); | 300 WasResized(); | 
| 301 } | 301 } | 
| 302 | 302 | 
| 303 void RenderWidgetHost::WasSwappedOut() { | |
| 
Charlie Reis
2011/04/29 17:53:53
I also moved this to RenderViewHost, since we don'
 | |
| 304 // Don't bother reporting hung state anymore. | |
| 305 StopHangMonitorTimeout(); | |
| 306 | |
| 307 // Inform the renderer that it can exit if no one else is using it. | |
| 308 Send(new ViewMsg_WasSwappedOut(routing_id_)); | |
| 309 } | |
| 310 | |
| 303 void RenderWidgetHost::WasResized() { | 311 void RenderWidgetHost::WasResized() { | 
| 304 if (resize_ack_pending_ || !process_->HasConnection() || !view_ || | 312 if (resize_ack_pending_ || !process_->HasConnection() || !view_ || | 
| 305 !renderer_initialized_) { | 313 !renderer_initialized_) { | 
| 306 return; | 314 return; | 
| 307 } | 315 } | 
| 308 | 316 | 
| 309 #if !defined(OS_MACOSX) | 317 #if !defined(OS_MACOSX) | 
| 310 gfx::Size new_size = view_->GetViewBounds().size(); | 318 gfx::Size new_size = view_->GetViewBounds().size(); | 
| 311 #else | 319 #else | 
| 312 // When UI scaling is enabled on OS X, allocate a smaller bitmap and | 320 // When UI scaling is enabled on OS X, allocate a smaller bitmap and | 
| (...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1290 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 1298 view_->CreatePluginContainer(deferred_plugin_handles_[i]); | 
| 1291 #endif | 1299 #endif | 
| 1292 } | 1300 } | 
| 1293 | 1301 | 
| 1294 deferred_plugin_handles_.clear(); | 1302 deferred_plugin_handles_.clear(); | 
| 1295 } | 1303 } | 
| 1296 | 1304 | 
| 1297 void RenderWidgetHost::StartUserGesture() { | 1305 void RenderWidgetHost::StartUserGesture() { | 
| 1298 OnUserGesture(); | 1306 OnUserGesture(); | 
| 1299 } | 1307 } | 
| OLD | NEW |