Extension ids are ASCII.

This is preliminary cleanup for a larger change.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76941 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc
index a20814b9..cb5fde3e 100644
--- a/chrome/browser/shell_integration.cc
+++ b/chrome/browser/shell_integration.cc
@@ -25,7 +25,7 @@
 
 std::string ShellIntegration::GetCommandLineArgumentsCommon(
     const GURL& url,
-    const string16& extension_app_id) {
+    const std::string& extension_app_id) {
   const CommandLine cmd = *CommandLine::ForCurrentProcess();
   std::wstring arguments_w;
 
@@ -55,7 +55,7 @@
   // during launch.
   if (!extension_app_id.empty()) {
     arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kAppId) +
-        L"=\"" + ASCIIToWide(UTF16ToASCII(extension_app_id)) + L"\"";
+        L"=\"" + ASCIIToWide(extension_app_id) + L"\"";
   } else {
     // Use '--app=url' instead of just 'url' to launch the browser with minimal
     // chrome.
diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h
index 6caed57..450c11b4 100644
--- a/chrome/browser/shell_integration.h
+++ b/chrome/browser/shell_integration.h
@@ -57,7 +57,7 @@
     // If |extension_id| is non-empty, this is short cut is to an extension-app
     // and the launch url will be detected at start-up. In this case, |url|
     // is still used to generate the app id (windows app id, not chrome app id).
-    string16 extension_id;
+    std::string extension_id;
     string16 title;
     string16 description;
     SkBitmap favicon;
@@ -79,8 +79,9 @@
   // NOTE: This function is dangerous, do not use!  You cannot treat
   // command lines as plain strings as there are metacharacters.
   // TODO(evanm): remove it.
-  static std::string GetCommandLineArgumentsCommon(const GURL& url,
-      const string16& extension_app_id);
+  static std::string GetCommandLineArgumentsCommon(
+      const GURL& url,
+      const std::string& extension_app_id);
 
 #if defined(USE_X11)
   // Returns filename of the desktop shortcut used to launch the browser.
@@ -97,7 +98,7 @@
   // used to launch Chrome.
   static std::string GetDesktopFileContents(
       const std::string& template_contents, const GURL& url,
-      const string16& extension_id, const string16& title,
+      const std::string& extension_id, const string16& title,
       const std::string& icon_name);
 
   static void CreateDesktopShortcut(const ShortcutInfo& shortcut_info,
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index eb88862..5e8a3f3 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -316,7 +316,7 @@
 // static
 std::string ShellIntegration::GetDesktopFileContents(
     const std::string& template_contents, const GURL& url,
-    const string16& extension_id, const string16& title,
+    const std::string& extension_id, const string16& title,
     const std::string& icon_name) {
   // See http://standards.freedesktop.org/desktop-entry-spec/latest/
   // Although not required by the spec, Nautilus on Ubuntu Karmic creates its
diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc
index 240eb6e..9a86b58 100644
--- a/chrome/browser/shell_integration_unittest.cc
+++ b/chrome/browser/shell_integration_unittest.cc
@@ -287,7 +287,7 @@
               ShellIntegration::GetDesktopFileContents(
                   test_cases[i].template_contents,
                   GURL(test_cases[i].url),
-                  EmptyString16(),
+                  "",
                   ASCIIToUTF16(test_cases[i].title),
                   test_cases[i].icon_name));
   }
diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
index 090a6aa..e36908d 100644
--- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -292,7 +292,7 @@
         ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this))  {
 
   // Get shortcut information now, it's needed for our UI.
-  shortcut_info_.extension_id = UTF8ToUTF16(app_->id());
+  shortcut_info_.extension_id = app_->id();
   shortcut_info_.url = GURL(app_->launch_web_url());
   shortcut_info_.title = UTF8ToUTF16(app_->name());
   shortcut_info_.description = UTF8ToUTF16(app_->description());
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc
index 982f74d..ee8a18e9 100644
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -475,7 +475,7 @@
       app_(app),
       ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
 
-  shortcut_info_.extension_id = UTF8ToUTF16(app_->id());
+  shortcut_info_.extension_id = app_->id();
   shortcut_info_.url = GURL(app_->launch_web_url());
   shortcut_info_.title = UTF8ToUTF16(app_->name());
   shortcut_info_.description = UTF8ToUTF16(app_->description());
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 099046ca..2e779289 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -94,7 +94,7 @@
 FilePath GetWebAppDir(const ShellIntegration::ShortcutInfo& info) {
   if (!info.extension_id.empty()) {
     std::string app_name = web_app::GenerateApplicationNameFromExtensionId(
-        UTF16ToUTF8(info.extension_id));
+        info.extension_id);
 #if defined(OS_WIN)
     return FilePath(UTF8ToWide(app_name));
 #elif defined(OS_POSIX)
@@ -391,7 +391,7 @@
   std::string app_name;
   if (!shortcut_info_.extension_id.empty()) {
     app_name = web_app::GenerateApplicationNameFromExtensionId(
-        UTF16ToUTF8(shortcut_info_.extension_id));
+        shortcut_info_.extension_id);
   } else {
     app_name = web_app::GenerateApplicationNameFromURL(
         shortcut_info_.url);