[VS Addin] Fix several issues with debugging PPAPI plugins

Add --ppapi-in-process so that the pepper plugins run
in the renderer process.  At some point in the past
the default must have changed which was causing the
VS addin code not to attach to the correct processes.

Pass http://localhost:5103 to chrome process that
we launch.  It seems that passing just 'localhost:5103'
no longer works.

Don't use the x-nacl mimetype for PPAPI plugins.  Instead
use x-ppapi.  The plugin is not permitted if x-nacl is
used.  Also, seems to be something that recently
broke.

Pass --no-first-run so that chrome doesn't try to log you
in each time you start with a new data dir.

TEST=test.sh
R=binji@chromium.org

Review URL: https://codereview.chromium.org/573823002

git-svn-id: https://nativeclient-sdk.googlecode.com/svn/trunk/src@1576 050acbb0-2703-11df-ab0a-9f3f633ae91d
diff --git a/InstallerResources/NaCl/ImportAfter/NaCl.override.props b/InstallerResources/NaCl/ImportAfter/NaCl.override.props
index 7b2ed41..fb6e662 100644
--- a/InstallerResources/NaCl/ImportAfter/NaCl.override.props
+++ b/InstallerResources/NaCl/ImportAfter/NaCl.override.props
@@ -12,7 +12,7 @@
   <!-- setup default debugging parameters -->
   <PropertyGroup>
     <LocalDebuggerCommand>$(CHROME_PATH)</LocalDebuggerCommand>
-    <LocalDebuggerCommandArguments Condition="$(Configuration) == 'Debug'">--enable-nacl-debug --no-sandbox localhost:$(NaClWebServerPort)/$(NaClIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --enable-nacl</LocalDebuggerCommandArguments>
-    <LocalDebuggerCommandArguments Condition="$(Configuration) != 'Debug'">localhost:$(NaClWebServerPort)/$(NaClIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --enable-nacl</LocalDebuggerCommandArguments>
+    <LocalDebuggerCommandArguments Condition="$(Configuration) == 'Debug'">--enable-nacl-debug --no-sandbox http://localhost:$(NaClWebServerPort)/$(NaClIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --enable-nacl --no-first-run</LocalDebuggerCommandArguments>
+    <LocalDebuggerCommandArguments Condition="$(Configuration) != 'Debug'">http://localhost:$(NaClWebServerPort)/$(NaClIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --enable-nacl --no-first-run</LocalDebuggerCommandArguments>
   </PropertyGroup>
 </Project>
diff --git a/InstallerResources/PPAPI_Patch/ImportAfter/PPAPI.override.props b/InstallerResources/PPAPI_Patch/ImportAfter/PPAPI.override.props
index c1ff666..f50845e 100644
--- a/InstallerResources/PPAPI_Patch/ImportAfter/PPAPI.override.props
+++ b/InstallerResources/PPAPI_Patch/ImportAfter/PPAPI.override.props
@@ -42,8 +42,8 @@
   <PropertyGroup>
     <TargetPath Condition="'$(TargetPath)' == ''">$([System.IO.Path]::Combine($(ProjectDir),$(OutDir)$(TargetName)$(TargetExt)))</TargetPath>
     <LocalDebuggerCommand>$(CHROME_PATH)</LocalDebuggerCommand>
-    <LocalDebuggerCommandArguments Condition="$(Configuration) == 'Debug'">--register-pepper-plugins="$(TargetPath)";application/x-nacl localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --wait-for-debugger-children</LocalDebuggerCommandArguments>
-    <LocalDebuggerCommandArguments Condition="$(Configuration) != 'Debug'">--register-pepper-plugins="$(TargetPath)";application/x-nacl localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data"</LocalDebuggerCommandArguments>
+    <LocalDebuggerCommandArguments Condition="$(Configuration) == 'Debug'">--register-pepper-plugins="$(TargetPath)";application/x-ppapi http://localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --no-first-run --ppapi-in-process --wait-for-debugger-children</LocalDebuggerCommandArguments>
+    <LocalDebuggerCommandArguments Condition="$(Configuration) != 'Debug'">--register-pepper-plugins="$(TargetPath)";application/x-ppapi http://localhost:$(NaClWebServerPort)/$(NaCLIndexHTML) --user-data-dir="$(ProjectDir)/chrome_data" --no-first-run --ppapi-in-process</LocalDebuggerCommandArguments>
     <LinkIncremental Condition="$(Configuration) == 'Debug'">true</LinkIncremental>
     <LinkIncremental Condition="$(Configuration) != 'Debug'">false</LinkIncremental>
   </PropertyGroup>
diff --git a/InstallerResources/examples/hello_nacl/hello_nacl/hello_nacl.c b/InstallerResources/examples/hello_nacl/hello_nacl/hello_nacl.c
index 0f4b33b..53b5265 100644
--- a/InstallerResources/examples/hello_nacl/hello_nacl/hello_nacl.c
+++ b/InstallerResources/examples/hello_nacl/hello_nacl/hello_nacl.c
@@ -65,7 +65,7 @@
 // - Go to the NaCl SDK directory and launch the httpd.py server.
 // - Launch Chrome, go to about:flags and enable the Native Client flag and
 //   relaunch Chrome
-// - Point Chrome at localhost:5103/hello_nacl
+// - Point Chrome at http://localhost:5103/hello_nacl
 
 
 #ifdef STEP6
diff --git a/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/hello_nacl_cpp.cc b/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/hello_nacl_cpp.cc
index f725e0f..9000ed4 100644
--- a/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/hello_nacl_cpp.cc
+++ b/InstallerResources/examples/hello_nacl_cpp/hello_nacl_cpp/hello_nacl_cpp.cc
@@ -65,7 +65,7 @@
 // - Go to the NaCl SDK directory and launch the httpd.py server.
 // - Launch Chrome, go to about:flags and enable the Native Client flag and
 //   relaunch Chrome
-// - Point Chrome at localhost:5103/hello_nacl_plus
+// - Point Chrome at http://localhost:5103/hello_nacl_plus
 
 #ifdef STEP6
 // remove Windows-dependent code.
diff --git a/InstallerResources/examples/hello_world_gles/hello_world_gles/common.js b/InstallerResources/examples/hello_world_gles/hello_world_gles/common.js
index f7df0d8..6901fe7 100644
--- a/InstallerResources/examples/hello_world_gles/hello_world_gles/common.js
+++ b/InstallerResources/examples/hello_world_gles/hello_world_gles/common.js
@@ -26,7 +26,10 @@
     moduleEl.setAttribute('width', width);
     moduleEl.setAttribute('height',height);
     moduleEl.setAttribute('src', tool + '/' + name + '.nmf');
-    moduleEl.setAttribute('type', 'application/x-nacl');
+    if (tool == 'win')
+      moduleEl.setAttribute('type', 'application/x-ppapi');
+    else
+      moduleEl.setAttribute('type', 'application/x-nacl');
 
     // The <EMBED> element is wrapped inside a <DIV>, which has both a 'load'
     // and a 'message' event listener attached.  This wrapping method is used
diff --git a/NativeClientVSAddIn/Strings.Designer.cs b/NativeClientVSAddIn/Strings.Designer.cs
index 0359381..ffb37bc 100644
--- a/NativeClientVSAddIn/Strings.Designer.cs
+++ b/NativeClientVSAddIn/Strings.Designer.cs
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:4.0.30319.296
+//     Runtime Version:4.0.30319.18444
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -169,7 +169,7 @@
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to --register-pepper-plugins=&quot;{0};application/x-nacl&quot;.
+        ///   Looks up a localized string similar to --register-pepper-plugins=&quot;{0};application/x-ppapi&quot;.
         /// </summary>
         internal static string PepperProcessPluginFlagFormat {
             get {
diff --git a/NativeClientVSAddIn/Strings.resx b/NativeClientVSAddIn/Strings.resx
index 9e52295..c916ea5 100644
--- a/NativeClientVSAddIn/Strings.resx
+++ b/NativeClientVSAddIn/Strings.resx
@@ -151,7 +151,7 @@
     <value>PPAPI</value>
   </data>
   <data name="PepperProcessPluginFlagFormat" xml:space="preserve">
-    <value>--register-pepper-plugins="{0};application/x-nacl"</value>
+    <value>--register-pepper-plugins="{0};application/x-ppapi"</value>
     <comment>Argument is plug-in assembly's path</comment>
   </data>
   <data name="PNaClPlatformName" xml:space="preserve">
diff --git a/UnitTests/ProjectSettingsTest.cs b/UnitTests/ProjectSettingsTest.cs
index 03728ac..425197a 100644
--- a/UnitTests/ProjectSettingsTest.cs
+++ b/UnitTests/ProjectSettingsTest.cs
@@ -307,8 +307,8 @@
 
       string propName = "LocalDebuggerCommandArguments";
       string dataDir = "--user-data-dir=\"$(ProjectDir)/chrome_data\"";
-      string address = "localhost:$(NaClWebServerPort)";
-      string targetFlag = "--register-pepper-plugins=\"$(TargetPath)\";application/x-nacl";
+      string address = "http://localhost:$(NaClWebServerPort)";
+      string targetFlag = "--register-pepper-plugins=\"$(TargetPath)\";application/x-ppapi";
       string debugChildrenFlag = "--wait-for-debugger-children";
       AllConfigsAssertPropertyContains(page, propName, dataDir, true);
       AllConfigsAssertPropertyContains(page, propName, address, true);
@@ -392,7 +392,7 @@
 
       string propName = "LocalDebuggerCommandArguments";
       string dataDir = "--user-data-dir=\"$(ProjectDir)/chrome_data\"";
-      string address = "localhost:$(NaClWebServerPort)";
+      string address = "http://localhost:$(NaClWebServerPort)";
       string naclFlag = "--enable-nacl";
       string naclDebugFlag = "--enable-nacl-debug";
       string noSandBoxFlag = "--no-sandbox";