Add support for the IE File->Save As command. This eventually ends up in Chrome via the new automation
message AutomationMsg_SaveAsAsync. Rest of the changes are to plumb this message across from IE to Chrome.

Fixes bug http://code.google.com/p/chromium/issues/detail?id=24039

Bug=24039
Test=Launch IE with OptinUrls set to *. Navigate to google.com and select File->Save As. The dialog should
     popup.

Review URL: http://codereview.chromium.org/563025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38145 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index a0c3d3c..9a02f042 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -462,6 +462,7 @@
                                     LoadExpandedExtension)
     IPC_MESSAGE_HANDLER(AutomationMsg_ShutdownSessionService,
                         ShutdownSessionService)
+    IPC_MESSAGE_HANDLER(AutomationMsg_SaveAsAsync, SaveAsAsync)
   IPC_END_MESSAGE_MAP()
 }
 
@@ -2236,3 +2237,11 @@
     Send(reply_message);
   }
 }
+
+void AutomationProvider::SaveAsAsync(int tab_handle) {
+  NavigationController* tab = NULL;
+  TabContents* tab_contents = GetTabContentsForHandle(tab_handle, &tab);
+  if (tab_contents)
+    tab_contents->OnSavePage();
+}
+