Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 8cd337440a1443a2a048d6ba99b7108cc5965f7a..7e485e169fa78ef36a23f92ef5f3085986fb3e64 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -150,6 +150,7 @@ |
#include "components/bookmarks/browser/bookmark_utils.h" |
#include "components/google/core/browser/google_url_tracker.h" |
#include "components/startup_metric_utils/startup_metric_utils.h" |
+#include "components/web_modal/popup_manager.h" |
#include "components/web_modal/web_contents_modal_dialog_manager.h" |
#include "content/public/browser/devtools_manager.h" |
#include "content/public/browser/download_item.h" |
@@ -442,6 +443,13 @@ Browser::Browser(const CreateParams& params) |
} |
fullscreen_controller_.reset(new FullscreenController(this)); |
+ |
+ // Must be initialized after window_. |
+ // This would be a DCHECK but tests. |
+ if (GetWebContentsModalDialogHost()) { |
+ popup_manager_.reset(new web_modal::PopupManager( |
+ GetWebContentsModalDialogHost())); |
+ } |
} |
Browser::~Browser() { |
@@ -890,6 +898,10 @@ void Browser::TabInsertedAt(WebContents* contents, |
int index, |
bool foreground) { |
SetAsDelegate(contents, this); |
+ |
+ if (popup_manager_.get()) |
+ popup_manager_->RegisterWith(contents); |
Mike Wittman
2014/06/25 02:38:50
The WCMDM is disassociated from the Browser on tab
Greg Billock
2014/06/25 19:06:14
Oh, I see what your saying -- it needs an api meth
Mike Wittman
2014/06/25 21:12:44
Yes, this behavior is unique to Browser.
|
+ |
SessionTabHelper* session_tab_helper = |
SessionTabHelper::FromWebContents(contents); |
session_tab_helper->SetWindowID(session_id()); |