Make sure ShellIntegration::CommandLineArgsForLauncher respects the UserDataDir policy.

If this is not done shortcuts created will not contain the right path and will
cause faulty behavior on Windows.

BUG=173237
TEST=As described in the bug.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183546 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index 674e12f..cd299c55 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -11,6 +11,7 @@
 #include "base/prefs/pref_service.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
+#include "chrome/browser/policy/policy_path_parser.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/pref_names.h"
@@ -62,6 +63,9 @@
   // Use the same UserDataDir for new launches that we currently have set.
   base::FilePath user_data_dir =
       cmd_line.GetSwitchValuePath(switches::kUserDataDir);
+#if defined(OS_MACOSX) || defined(OS_WIN)
+  policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
+#endif
   if (!user_data_dir.empty()) {
     // Make sure user_data_dir is an absolute path.
     if (file_util::AbsolutePath(&user_data_dir) &&