<webview>: Fix resize

With the introduction of custom elements, we also stopped issuing resize IPCs to
the browser process prior to attachment. This was to prevent a crash when attempting
to access the embedder WebContents on new window attachment. This is bad because
in regular webview instantiation, resize would never happen until the content of
the webview changes (on UpdateRectACK). This CL sends an BrowserPluginMsg_Attach_ACK
on all attachment types (new webview on initial navigation and new window attachment) instead
of just new window attachment.

BUG=277736
Test=WebViewTest.Shim_TestResizeWebviewResizesContent

Review URL: https://chromiumcodereview.appspot.com/22918020

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219143 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc
index 3207034..96e60e1f 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -546,6 +546,18 @@
         GetWebContents()->GetRenderViewHost());
     guest_rvh->SetInputMethodActive(true);
   }
+
+  // Inform the embedder of the guest's information.
+  // We pull the partition information from the site's URL, which is of the form
+  // guest://site/{persist}?{partition_name}.
+  const GURL& site_url = GetWebContents()->GetSiteInstance()->GetSiteURL();
+  BrowserPluginMsg_Attach_ACK_Params ack_params;
+  ack_params.storage_partition_id = site_url.query();
+  ack_params.persist_storage =
+      site_url.path().find("persist") != std::string::npos;
+  ack_params.name = name_;
+  SendMessageToEmbedder(
+      new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params));
 }
 
 BrowserPluginGuest::~BrowserPluginGuest() {
@@ -1132,18 +1144,6 @@
 
   Initialize(embedder_web_contents, params);
 
-  // Inform the embedder of the guest's information.
-  // We pull the partition information from the site's URL, which is of the form
-  // guest://site/{persist}?{partition_name}.
-  const GURL& site_url = GetWebContents()->GetSiteInstance()->GetSiteURL();
-  BrowserPluginMsg_Attach_ACK_Params ack_params;
-  ack_params.storage_partition_id = site_url.query();
-  ack_params.persist_storage =
-      site_url.path().find("persist") != std::string::npos;
-  ack_params.name = name_;
-  SendMessageToEmbedder(
-      new BrowserPluginMsg_Attach_ACK(instance_id_, ack_params));
-
   SendQueuedMessages();
 
   RecordAction(UserMetricsAction("BrowserPlugin.Guest.Attached"));