| Index: chrome/browser/ui/views/extensions/extension_popup.cc
|
| diff --git a/chrome/browser/ui/views/extensions/extension_popup.cc b/chrome/browser/ui/views/extensions/extension_popup.cc
|
| index 1467f24de70ee9fd4999d46cd5dfa44f68e4eb1d..ded044a2cf99f7523759d72ec81b7ee14db5e20e 100644
|
| --- a/chrome/browser/ui/views/extensions/extension_popup.cc
|
| +++ b/chrome/browser/ui/views/extensions/extension_popup.cc
|
| @@ -67,9 +67,6 @@ ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host,
|
| // ExtensionPopup closes itself on very specific de-activation conditions.
|
| set_close_on_deactivate(false);
|
|
|
| - // Wait to show the popup until the contained host finishes loading.
|
| - registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
|
| - content::Source<content::WebContents>(host->host_contents()));
|
|
|
| // Listen for the containing view calling window.close();
|
| registrar_.Add(
|
| @@ -79,6 +76,18 @@ ExtensionPopup::ExtensionPopup(extensions::ExtensionViewHost* host,
|
| content::DevToolsAgentHost::AddAgentStateCallback(devtools_callback_);
|
|
|
| GetExtensionView(host)->GetBrowser()->tab_strip_model()->AddObserver(this);
|
| +
|
| + // If the host had somehow finished loading, then we'd miss the notification
|
| + // and not show. This seems to happen in single-process mode.
|
| + if (host_->has_loaded_once()) {
|
| + ShowBubble();
|
| + } else {
|
| + // Wait to show the popup until the contained host finishes loading.
|
| + registrar_.Add(this,
|
| + content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
|
| + content::Source<content::WebContents>(
|
| + host_->host_contents()));
|
| + }
|
| }
|
|
|
| ExtensionPopup::~ExtensionPopup() {
|
| @@ -170,21 +179,13 @@ void ExtensionPopup::OnAnchorWindowActivation() {
|
| }
|
|
|
| // static
|
| -ExtensionPopup* ExtensionPopup::ShowPopup(const GURL& url,
|
| - Browser* browser,
|
| - views::View* anchor_view,
|
| - views::BubbleBorder::Arrow arrow,
|
| - ShowAction show_action) {
|
| - extensions::ExtensionViewHost* host =
|
| - extensions::ExtensionViewHostFactory::CreatePopupHost(url, browser);
|
| - auto popup = ExtensionPopup::Create(host, anchor_view, arrow, show_action);
|
| -
|
| - // If the host had somehow finished loading, then we'd miss the notification
|
| - // and not show. This seems to happen in single-process mode.
|
| - if (host->has_loaded_once())
|
| - popup->ShowBubble();
|
| -
|
| - return popup;
|
| +ExtensionPopup* ExtensionPopup::ShowPopup(
|
| + scoped_ptr<extensions::ExtensionViewHost> host,
|
| + views::View* anchor_view,
|
| + views::BubbleBorder::Arrow arrow,
|
| + ShowAction show_action) {
|
| + return ExtensionPopup::Create(
|
| + host.release(), anchor_view, arrow, show_action);
|
| }
|
|
|
| void ExtensionPopup::ShowBubble() {
|
|
|