Index: ui/views/controls/webview/webview.cc |
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc |
index a100ebea5ff0a4ed20a861b6407a73e3de4ea52e..01078408eea4c5c79297a63c5af7d45a589990ca 100644 |
--- a/ui/views/controls/webview/webview.cc |
+++ b/ui/views/controls/webview/webview.cc |
@@ -122,6 +122,17 @@ ui::TextInputClient* WebView::GetTextInputClient() { |
return NULL; |
} |
+scoped_ptr<content::WebContents> WebView::SwapWebContents( |
+ scoped_ptr<content::WebContents> new_web_contents) { |
+ if (wc_owner_) |
+ wc_owner_->SetDelegate(NULL); |
+ scoped_ptr<content::WebContents> old_web_contents(wc_owner_.Pass()); |
+ wc_owner_ = new_web_contents.Pass(); |
+ wc_owner_->SetDelegate(this); |
miu
2014/07/22 19:27:53
This should be guarded by: if (wc_owner_)
flackr
2014/07/22 20:01:33
Done.
|
+ SetWebContents(wc_owner_.get()); |
+ return old_web_contents.Pass(); |
+} |
+ |
void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
// In most cases, the holder is simply sized to fill this WebView's bounds. |
// Only WebContentses that are in fullscreen mode and being screen-captured |