Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(459)

Unified Diff: ui/views/controls/webview/webview.cc

Issue 398603002: athena: Handle WebContents created for new windows and create activities for these. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only set delegate if actual web contents was passed to SwapWebContents. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..630ed48558c77e56bcae8244a15500e38ef2aa29 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -122,6 +122,18 @@ 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();
+ if (wc_owner_)
+ wc_owner_->SetDelegate(this);
+ 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
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698